//var switchseed = 1; //行业精选切换标记 //var divCount = $("#IndustryFeatured").find("div[name='industry']").length; var timer; $(function () { //IndustryFeaturedShow(); $("a[data-field='topad']").click(function () { var pageinfo = $(this).attr("data-page"); saveNewCustVisitInfo("微信商城", "", "", pageinfo); }); $.fn.extend({ Scroll:function(opt,callback){ //参数初始化 if(!opt) var opt={}; var _this = $("#scrollDiv").children(); var lineH = 121, //_this.find("li:first").height(), //获取行高 line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数,默认为一屏,即父容器高度 speed=opt.speed?parseInt(opt.speed,10):300, //卷动速度,数值越大,速度越慢(毫秒) timer=opt.timer?parseInt(opt.timer,10):2000; //滚动的时间间隔(毫秒) if(line==0) line=1; var upHeight=0-line*lineH; //滚动函数 scrollUp=function(){ _this.animate({ marginTop:upHeight },speed,function(){ for(i=1;i<=line;i++){ _this.find("div[class=indlist]:first").appendTo(_this); } _this.css({marginTop:0}); }); } //鼠标事件绑定 _this.hover(function(){ clearInterval(timerID); },function(){ timerID=setInterval("scrollUp()",timer); }).mouseout(); } }) ; if ($("#scrollDiv").find("div[class=indlist]").length > 3) { $("#scrollDiv").height(363); $("#scrollDiv").Scroll({line:1,speed:500,timer:3000}); } //else{ // var height=$("#scrollDiv").find("ul").find("li").length*107; // $("#scrollDiv").height(height); //} }) function saveNewCustVisitInfo(type, cbsid, cbnumber,pageinfo) { $.ajax({ url: "/Handler/SaveNewCustVisitInfo.ashx", cache: false, type: "Post", data: { type: type, cbsid: cbsid, cbnumber: cbnumber,pageinfo:pageinfo }, dataType: "json", success: function (data) { } }); } //function IndustryFeaturedShow() { // timer = setInterval(function () { // Switch(); // if (switchseed >= divCount) { // switchseed = 1; // } // else { // switchseed++; // } // }, 1500); //} //function Switch() { // $("#IndustryFeatured").find("div[name='industry']").each(function () { // if ($(this).attr('id') == switchseed) { // $(this).show(); // } // else { // $(this).hide(); // } // }); //} //function DivOnMouseOver(obj) { // switchseed = $(obj).attr("id"); // Switch(); // clearInterval(timer); //} //function DivOnMouseOut(obj) { // if (switchseed != divCount) { // switchseed++; // } // else { // switchseed = 1; // } // IndustryFeaturedShow(); //}