$(function(){ /*左侧高度等于高度*/ // $(".sider").height($(".index_main").height()); // $(".sider").height($(".insider_main").height()); // $(".sider").height($(".pro_index").height()); // $(".nav_dl dt").bind("click",function(){ // $(this).addclass("on").siblings("dt").removeclass("on"); // $(this).next("dd").show().siblings("dd").hide(); // }) }) /*图片左右滚动*/ ;(function($){ $.fn.scroll = function(options){ options = jquery.extend({ speed: "300", page: 6 },options); return this.each(function(){ $.fn.scroll.run($(this),options); }); }; $.fn.scroll.run = function($this,options){ var ul = $("ul",$this), li = ul.children(), len = li.length,//获取li的个数 $page = math.ceil(len / options.page), li_left = parseint(li.css("margin-left")), li_right = parseint(li.css("margin-right")), li_width = (li.width()+li_left+li_right)*options.page, count = 0, $next = $(".next",$this), $prev = $(".prev",$this), animating = false; ul.width(li_width*$page); var back = $next.bind("click",function(){ if($page < 1 || count >= $page-1){ return false; } count++; ul.stop(true,true).animate({left: '-=' + li_width + 'px'},options.speed); }); var go = $prev.bind("click",function(){ if(count <= 0){ return false; } count--; ul.stop(true,true).animate({left: '+=' + li_width + 'px'}, options.speed); }); }; })(jquery);