jQuery(document).ready(function($){ //refresh the screen on browser resize? var YTScript = window.YTScript = window.YTScript || { slidePositions:function(wrap, txt, events){ $i = 0; $(wrap).find('div.module').each(function(){ var $this = $(this); w_btn = $this.find('.btn-special').width(); $this.css('top', $i*(w_btn+5)); $i++; $(wrap).find('div.module').removeClass('active'); $this.css('width', $this.width()); $this.css(txt, - $this.width()); $this.find('.btn-special').bind(events, function(){ //if($this.attr('class').contains('active')){ if ( $this.attr('class').indexOf("active") !== -1 ){ // btn if(txt == 'left') $this.animate({'left': w_btn }, 200, function(){ $this.show().animate({'left':- $this.width()}); }); else $this.animate({'right': w_btn }, 200, function(){ $this.show().animate({'right':- $this.width()}); }); // Module content if(txt == 'left') $(this).animate({'left': - w_btn}, 200, function(){ $(this).show().animate({'left': $this.width()}); }); else $(this).animate({'right': - w_btn}, 200, function(){ $(this).show().animate({'right': $this.width()}); }); // Class active $this.removeClass('active'); }else{ // Other modules $(wrap).find('div.module').each(function(){ //alert(txt); o_mod = $(this); (txt == 'left')?o_mod.animate({'left': - o_mod.width()}, 200):o_mod.animate({'right': - o_mod.width()}, 200); o_mod.removeClass('active'); (txt == 'left')?o_mod.find('.btn-special').animate({'left': o_mod.width()}, 200):o_mod.find('.btn-special').animate({'right': o_mod.width()}, 200); }); // btn if(txt == 'left') $(this).animate({'left': $this.width()}, 200, function(){ $(this).show().animate({'left': - w_btn}); }); else $(this).animate({'right': $this.width()}, 200, function(){ $(this).show().animate({'right': - w_btn}); }); // Module content if(txt == 'left') $this.animate({'left':- $this.width()}, 200, function(){ $this.show().animate({'left': w_btn}); }); else $this.animate({'right':- $this.width()}, 200, function(){ $this.show().animate({'right': w_btn}); }); // Class active $this.addClass('active'); } }) }); }, slidePositionNotice:function(wrap, txt, cookiename){ var $this = $(wrap); h_modcontent = $this.height(); $this.css('height', h_modcontent); $this.prepend("