Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions jquery.tabslet.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
};

var options = $.extend(defaults, options);
options = $.extend(defaults, options);

return this.each(function() {

Expand Down Expand Up @@ -128,17 +128,19 @@

);

var init = eval("elements." + $this.opts.mouseevent + "(fn)");
var init = function() {
eval("elements." + $this.opts.mouseevent + "(fn)");
};

init;
init();

var t;

var forward = function() {

i = ++i % elements.length; // wrap around

$this.opts.mouseevent == 'hover' ? elements.eq(i).trigger('mouseover') : elements.eq(i).click();
$this.opts.mouseevent === 'hover' ? elements.eq(i).trigger('mouseover') : elements.eq(i).click();

if ($this.opts.autorotate) {

Expand All @@ -154,7 +156,7 @@

}

}
};

if ($this.opts.autorotate) {

Expand Down Expand Up @@ -196,13 +198,13 @@

var move = function(direction) {

if (direction == 'forward') i = ++i % elements.length; // wrap around
if (direction === 'forward') i = ++i % elements.length; // wrap around

if (direction == 'backward') i = --i % elements.length; // wrap around
if (direction === 'backward') i = --i % elements.length; // wrap around

elements.eq(i).click();

}
};

$this.find(options.controls.next).click(function() {
move('forward');
Expand Down Expand Up @@ -234,9 +236,7 @@
$(this).removeAttr('style').css( 'display', _cache_div[i] );
});
});

}

});

};
Expand Down