Reputation: 7035
As the title suggests I'm looking for a way to initiate the jQuery Cloud Zoom script so that it runs when the user clicks an element on the page and not when hovering an image. I've tried the official forum for the plugin but with no luck, perhaps someone here has created a similar solution before.
Upvotes: 2
Views: 5044
Reputation: 1
You need to change directly in cloudjs file mousemove............replace mousemove to click event
Upvotes: 0
Reputation: 2707
since version V3.0 rev 1302271415 you can achieve this behavior by setting the cloudzoom option "mouseTriggerEvent".
Example:
html:
<a href="/link/to/big/img.jpg" class="zoom">
<img src="/link/to/small/img.jpg" width="50" height="50" alt="" />
</a>
js:
jQuery('a.zoom img').CloudZoom({mouseTriggerEvent: 'click'});
See all available options Cloud Zoom Quickstart Guide
Upvotes: 0
Reputation: 385
use this code
$(document).ready(function(){
$('.cloud-zoom-gallery').CloudZoom();
$('#cloudZoom').click(function(){
$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();
return false;
})
});
Upvotes: 2
Reputation: 6057
Have you tried this:
$(document).ready(function () {
$('#itemToZoom').Click(new function(){
$(this).CloudZoom();
});
});
Upvotes: 2