Team:AUC TURKEY/Test
From 2013hs.igem.org
(Difference between revisions)
Line 59: | Line 59: | ||
if (opts.width) | if (opts.width) | ||
$cont.width(opts.width); | $cont.width(opts.width); | ||
- | if (opts.height | + | if (opts.height) |
- | + | if(opts.height != 'auto') | |
+ | $cont.height(opts.height); | ||
var first = 0; | var first = 0; | ||
Line 71: | Line 72: | ||
els[first].style.removeAttribute('filter'); | els[first].style.removeAttribute('filter'); | ||
- | if (opts.fit | + | if (opts.fit) |
- | + | if(opts.width) | |
- | if (opts.fit | + | $slides.width(opts.width); |
- | + | if (opts.fit) | |
+ | if(opts.height) | ||
+ | if(opts.height != 'auto') | ||
+ | $slides.height(opts.height); | ||
if (opts.pause) | if (opts.pause) | ||
$cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;}); | $cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;}); | ||
Line 84: | Line 88: | ||
$slides.each(function() { | $slides.each(function() { | ||
var $el = $(this); | var $el = $(this); | ||
- | this.cycleH = | + | if(opts.fit) { |
- | + | this.cycleH = opts.height ? opts.height : $el.height(); | |
+ | this.cycleW = opts.width ? opts.width : $el.width(); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | this.cycleH = $el.height(); | ||
+ | this.cycleW = $el.width(); | ||
+ | } | ||
}); | }); | ||
Line 114: | Line 125: | ||
opts.after[1].apply(e0, [e0, e0, opts, true]); | opts.after[1].apply(e0, [e0, e0, opts, true]); | ||
- | if (opts.click | + | if (opts.click) |
- | + | if(!opts.next) | |
+ | opts.next = opts.click; | ||
if (opts.next) | if (opts.next) | ||
$(opts.next).unbind('click.cycle').bind('click.cycle', function(){return advance(els,opts,opts.rev?-1:1);}); | $(opts.next).unbind('click.cycle').bind('click.cycle', function(){return advance(els,opts,opts.rev?-1:1);}); | ||
Line 132: | Line 144: | ||
return; | return; | ||
var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide]; | var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide]; | ||
- | if (p.cycleTimeout === 0 | + | if (p.cycleTimeout === 0) |
- | + | if(!manual) | |
+ | return; | ||
if (manual || !p.cyclePause) { | if (manual || !p.cyclePause) { |
Revision as of 09:25, 13 June 2013