Subversion Repositories SmartDukaan

Rev

Rev 1035 | Rev 4127 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1035 Rev 1048
Line 32... Line 32...
32
     });
32
     });
33
     
33
     
34
     $(".slider .next").click(function(){
34
     $(".slider .next").click(function(){
35
          //Remove the exist selector
35
          //Remove the exist selector
36
          //Set the width to the widest of either
36
          //Set the width to the widest of either
37
          var $div =$('div',this.parentNode)
37
          var $div =$('div',this.parentNode);
38
          ,maxoffset = $('li:last',$div).width()+$('li:last',$div).offset().left - $('li:first',$div).offset().left - $div.width()
38
          var maxoffset = $('li:last',$div).width()+$('li:last',$div).offset().left - $('li:first',$div).offset().left - $div.width();
39
          ,offset = Math.abs(parseInt( $('ul',$div).css('marginLeft') ))
39
          var offset = Math.abs(parseInt( $('ul',$div).css('marginLeft') ));
40
          ,diff = $div.width();
40
          var diff = $div.width();
41
 
41
 
42
          if( offset >= maxoffset )
42
          if( offset >= maxoffset ){
43
               return;
43
        	 return;
44
          else if ( offset + diff >= maxoffset ){
44
          }else if( offset + diff >= maxoffset ){
45
               diff = maxoffset - offset + 20;
45
               diff = maxoffset - offset + 20;
46
               // Hide this
46
               // Hide this
47
               $(this).css('visibility','hidden');
47
               $(this).css('visibility','hidden');
48
          }
48
          }
49
          // enable the other
49
          // enable the other