/***** *婀栧崡纾佹诞闆嗗洟闂ㄦ埛缃戠珯棣栭〉JS鏂囦欢 *@crtime:2019骞?1鏈?9鏃?0:51 *@Company:婀栧崡寰薄绉戞妧鏈夐檺鍏徃 www.microxiang.com *@Author:鏉庡垰(moaol@foxmail.com) *@modifyLog: what when who *澧炲姞棣栭〉婕傛诞鍔熻兘 20190221 ligang */ $(function(){ var _wap = $("body[wap=true]"); if(_wap.size()>0) { $(".main").addClass("mainwapdom"); //鐒︾偣鍥 TouchSlide({ slideCell:"#c-banner", titCell:".hd ul li", //寮€鍚嚜鍔ㄥ垎椤 autoPage:true 锛屾鏃惰缃 titCell 涓哄鑸厓绱犲寘瑁瑰眰 mainCell:".bd ul", effect:"left", //autoPlay:true, //鑷姩鎾斁 //delayTime:1000 }); //鏂伴椈涓績 TouchSlide({ slideCell:"#main-xwzx", titCell:".hd ul li", //寮€鍚嚜鍔ㄥ垎椤 autoPage:true 锛屾鏃惰缃 titCell 涓哄鑸厓绱犲寘瑁瑰眰 mainCell:".bd", effect:"left", //autoPlay:true, //鑷姩鎾斁 //delayTime:1000 }); //甯傚満寮€鍙 TouchSlide({ slideCell:"#main-xmkf", titCell:".hd li", //寮€鍚嚜鍔ㄥ垎椤 autoPage:true 锛屾鏃惰缃 titCell 涓哄鑸厓绱犲寘瑁瑰眰 mainCell:".bd", effect:"left", //autoPlay:true, //鑷姩鎾斁 //delayTime:1000 }); $(".xmkf-title a").attr("href","javascript:;"); //椤圭洰寮€鍙 TouchSlide({ slideCell:"#main-zbtb", titCell:".hd ul li", //寮€鍚嚜鍔ㄥ垎椤 autoPage:true 锛屾鏃惰缃 titCell 涓哄鑸厓绱犲寘瑁瑰眰 mainCell:".bd", effect:"left", //autoPlay:true, //鑷姩鎾斁 //delayTime:1000 }); $("#nav .sub").remove(); }else{ //椤堕儴Banner婊戝姩 jQuery(".main-top").slide({mainCell:".bd>ul",autoPlay:true,interTime:4000,effect:"fold",delayTime:1000}); jQuery(".inBox").slide({ titCell:".inhd li",mainCell:".inbd" }); } //棣栭〉婕傛诞骞垮憡 var text = document.getElementById("sypf"); if(text) { var xPos = 300; var yPos = 200; var step = 1; var delay = 30; var height = 0; var Hoffset = 0; var Woffset = 0; var yon = 0; var xon = 0; var pause = true; var interval; text.style.top = yPos+"px"; function changePos() { width = $(window).width(); height = $(window).height(); Hoffset = text.offsetHeight; Woffset = text.offsetWidth; text.style.left = xPos + document.body.scrollLeft+"px"; text.style.top = yPos + document.body.scrollTop+"px"; if (yon) {yPos = yPos + step;} else {yPos = yPos - step;} if (yPos < 0) {yon = 1;yPos = 0;} if (yPos >= (height - Hoffset)) {yon = 0;yPos = (height - Hoffset);} if (xon) {xPos = xPos + step;} else {xPos = xPos - step;} if (xPos < 0) {xon = 1;xPos = 0;} if (xPos >= (width - Woffset)) {xon = 0;xPos = (width - Woffset); } } function start() { text.visibility = "visible"; interval = setInterval(changePos, delay); } function pause_resume() { if(pause) { clearInterval(interval); pause = false; } else { interval = setInterval(changePos,delay); pause = true; } } //start();//鍙栨秷棣栭〉婕傛诞 20170517 start(); $("#sypf").hover(function(){ pause = true; pause_resume(); },function(){ pause = false; pause_resume(); }) $("#close").click(function(){ pause = true; pause_resume(); $("#sypf").remove(); }) } })