Jquery Cycle Plugin - Multiple Divs With Cycle Plugin From One Script?
Im new to jquery/javascript and need help! I want to use the cycle plugin in multiple divs with different images in each div. Each div is the same size and each image is the same s
Solution 1:
I made this example:
http://jsfiddle.net/oceog/YHLz2/11/
$(function() {
$('.box').each(function() {
var $this = $(this);
$this.cycle({
fx: 'fade',
speed: 300,
timeout: 0,
next: $this,
pause: 1
});
});
});
it works as expected, yours too. May be you use too old jquery ? (current is 1.8)
if answer not fit your problem, can you please edit jsfiddle to show where the problem ?
- when I load the page
- when I click on my logo, linked to index.html
I think when you load the page you load not index.html, but index.htm, or index.php or something else, check your site directory
The jsfiddle should repeat your problem, not just show your structure
if your site on the internet - give me link and i will check
Try to change your code to the following:
$(document).load(function() {
$('.box').each(function() {
var $this = $(this);
$this.cycle({
fx: 'fade',
speed: 300,
timeout: 0,
next: $this,
pause: 1
});
});
});
Post a Comment for "Jquery Cycle Plugin - Multiple Divs With Cycle Plugin From One Script?"