Answer the question
In order to leave comments, you need to log in
How to open an image in a window when clicked?
Good day, friends. I installed the Slick slider myself, the settings are as follows:
<script type="text/javascript">
$('.sl').slick({
slidesToShow: 3,
slidesToScroll: 1,
autoplay: true,
prevArrow: '<div class="prevg"><img src="../img/icon/arrow_prew.png"></div>',
nextArrow: '<div class="nextarr"><img src="../img/icon/arrow_next.png"></div>',
autoplaySpeed: 2000,
});
</script>
Answer the question
In order to leave comments, you need to log in
Install a plugin for viewing images in a modal window, such as fancybox or something easier.
Hello!
You can do it like a modal window with background dimming. Something like this:
HTML:
<p id="test">
<img src="1.jpg" alt="Image" title="Image" width="200" id="img">
</p>
$(document).ready(function () {
$("#img").on("click" , function (event) {
var ready = 0
$(event.target).parent().css("text-align", "center");
$(event.target).animate ({
width: $(event.target).width() * 5,
height: $(event.target).height() * 5,
} , 3000);
var ready = 1
if (ready == 1) {
$('body').css("background", "#616161")
}
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question