1
My idea is as follows, I am opening an image in a modalBox ( or Box image, sorry to say something incorrect because I am beginner in the subject) in javascript, how do I call the zoom function after calling the modal box function?
Thank you.
Below is the code I’m using:
rotating here
<span class='zoom' id='ex3'>
<img id="myImg" src="img/map1.jpg" alt="Trolltunga, Norway" width="300" height="200">
<p>Hover</p>
</span>
<div id="myModal" class="modal">
<span class="close">×</span>
<img class="modal-content" id="img01">
<div id="caption"></div>
</div>
Javascript:
// Get the modal
var modal = document.getElementById('myModal');
// Get the image and insert it inside the modal - use its "alt" text as a caption
var img = document.getElementById('myImg');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
var
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
captionText.innerHTML = this.alt;
}
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
And this is the function I want to call:
says Voce wants this function : //Zoom function
$(document).ready(function(){
$('#ex3').zoom({ on:'click' });
});
//End of Function
Want to post the code you already tried, and the errors that followed, in your post.
– MoshMage
Moshmage edited the question and added the code
– Paulo Cesar
Yes I’m using
– Paulo Cesar