I’m a JQuery noob and I’ve run into a little issue that I can’t solve.
I’m using the JQuery Cycle plugin. When I preview the page, I am able to click anywhere on the page and the slideshow is triggered.
I’d like the slideshow to cycle only when the image or div is clicked.
My code is as follows:
$('.slideShow').cycle({
fx: 'scrollUp',
speed: 300,
next: this,
timeout: 0,
});
The html is as follows:
<div class="slideShow">
<img src="images/img01.jpg" />
<img src="images/img02.jpg" />
</div>
I’ve tried to wrap the JS in a click function, which doesn’t work.
Thank you for any help.
The “next” attribute should be a jquery selector, not a javascript reference.
You should use a selector like: