File: /www/wwwroot/shzthfdcpg.com/wp-content/themes/shzhaotao/js/script.js
jQuery(document).ready(function(){
jQuery(".vjs-big-play-button").show();
videojs.options.flash.swf="video-js.swf"/*tpa=http://www.580web.cn/p519/skin/p519/js/xgcj/video-js.swf*/
if (document.documentMode<=8){jQuery(".page_style").css({"min-width":"1200px"});}
else
{
jQuery("head").append('<meta name="viewport" content="width=device-width,initial-scale=1">');
FunNavigation2(1,"menu_box","󰀥","static")
FunNavigation2(1,"nav_menu","󰀥","static")
FunNavigation2(2,"menu_box","󰅭","absolute")
FunNavigation2(2,"nav_menu","󰅭","static")
WowS("fadedown","fadeInDown");
WowS("fadeleft","fadeInLeft");
WowS("faderight","fadeInRight");
WowS("fadeup","fadeInUp");
//Wows("animates","fadeInUp",1);
Wows("gsdt_left","fadeInLeft",1);
Wows("gsdt_right","fadeInRight",1);
Wows("zxyhhd","fadeInDown",4);
Wows("zpzs","fadeInDown",4);
Wows("kslj_left","fadeInDown",4);
ZDZJheight();
Lmdjhd();
}
//jQuery(".nav_menu").children("ul").children("li").children("a").append("<i></i>")
/* if(jQuery(".nav_menu").children("ul").children("li").length<=1){jQuery(".nav_menu").children("ul").css({"display":"none"});}; 解决方案*/
var $jjyc_yc_com=jQuery(".jjyc").children("li.yc_com");
$jjyc_yc_com.eq(0).addClass("current").children(".tits").children(".s1").text("-");
$jjyc_yc_com.each(function(i){
jQuery(this).children(".tits").click(function(){
jQuery(this).children(".s1").text("-").parents("li.yc_com").siblings().find(".s1").text("+");
jQuery(this).siblings(".coms").slideDown().parent("li").siblings().children(".coms").slideUp();
jQuery(this).parent("li").addClass("current").siblings().removeClass("current");
});
});
sylb();/*首页轮播*/
});
jQuery(window).resize(function(){ //放大缩小时判断
ZDZJheight();
Lmdjhd();
});
function Lmdjhd() /*栏目点击缩小滑动效果*/
{
var $windows=jQuery(window).innerWidth();
if($windows>=1000)
{
jQuery(".menu_box").children("ul").children("li").each(function(p) {
jQuery(this).children("a").click(function(){
var $this_href=jQuery(this).attr("href");
jQuery(".page_style").css({"transform":"scale(0.89,0.89)","transition":"transform 0.5s ease"});
jQuery(".page_style").after('<div class="page_hd"></div>')
jQuery(".page_hd").animate({"top":"0px"},1100,function(){
window.location.href=$this_href;
});
return false;
})
});/*栏目点击缩小滑动效果*/
}else{jQuery(".menu_box").children("ul").children("li").children("a").unbind();return false;}
}
function sylb()
{
var $mknc_zybk_box=jQuery(".mknc_zybk_box");
$mknc_zybk_box.each(function(i) {
jQuery(this).addClass("mknc_zybk_box"+i)
var $mk_zybk_box=jQuery(".mknc_zybk_box"+i).parents(".mk_zybk_box");
jQuery(this).append(jQuery(".mknc_zybk_box"+i).html());
var $zybk_left=jQuery(".mknc_zybk_box"+i).children(".zybk_left");
var $zybk_left_len=$zybk_left.length;
var $zybk_left_width=$zybk_left.width();
var $zybk_prev=jQuery(".mknc_zybk_box"+i).parent(".gjqcbh").siblings(".zybk_prev");
var $zybk_next=jQuery(".mknc_zybk_box"+i).parent(".gjqcbh").siblings(".zybk_next")
var $zybk_left_margin_left=parseInt($zybk_left.css("margin-left")),
$zybk_left_margin_right=parseInt($zybk_left.css("margin-right")),
$zybk_left_margin=$zybk_left_margin_left+$zybk_left_margin_right;
jQuery(".mknc_zybk_box"+i).css({"width":$zybk_left_len*($zybk_left_width+$zybk_left_margin)+"px"});
var lc1=0,rc1=$zybk_left_len/2;
$zybk_prev.click(function(){
jQuery(".mknc_zybk_box"+i).stop(true,true);
if(lc1<1)
{ rc1=0;
lc1=$zybk_left_len/2;
jQuery(".mknc_zybk_box"+i).css({'margin-left':'-'+lc1*($zybk_left_width+$zybk_left_margin)+'px'});
}
lc1--;
rc1++;
jQuery(".mknc_zybk_box"+i).animate({'margin-left':'+='+($zybk_left_width+$zybk_left_margin)+'px'},1000);
});
$zybk_next.click(function(){
ZYBKnext()
});
function ZYBKnext()
{
jQuery(".mknc_zybk_box"+i).stop(true,true);
if(rc1<1)
{ lc1=0;
rc1=$zybk_left_len/2;
jQuery(".mknc_zybk_box"+i).css({'margin-left':'-0px'});
}
lc1++;
rc1--;
jQuery(".mknc_zybk_box"+i).animate({'margin-left':'-='+($zybk_left_width+$zybk_left_margin)+'px'},1000);
};
var times=setInterval(ZYBKnext,"5000") //为自动重复,setTimeout不会重复。
$mk_zybk_box.mouseenter(function(){clearInterval(times)});
$mk_zybk_box.mouseleave(function(){times=setInterval(ZYBKnext,"5000")});//clearInterval(对象) 清除已设置的setInterval对象
});
}
function ZDZJheight()
{
var $windows=jQuery(window).innerWidth();
var $nav_menu_ul_li=jQuery(".nav_menu").children("ul").children("li");
//if (document.documentMode <=8){$nav_menu_ul_li.children("ul").hide();return;};
if($windows<1000){$nav_menu_ul_li.children("ul").css({"display":"block"});}
else{$nav_menu_ul_li.children("ul").css({"display":"none"});};
if($nav_menu_ul_li.children("ul").length<=0){return;};
$nav_menu_ul_li.each(function(j){
if($nav_menu_ul_li.eq(j).children("a").attr("class").indexOf("current")>0){
if(jQuery(this).children("ul").children("li").children("a").attr("href").indexOf(Sublanmu_Id)>0)
{
if($nav_menu_ul_li.children("ul").size()>0)
{
jQuery(this).children("ul").css({"display":"block"});
var $this_ulhei=jQuery(this).children("ul").innerHeight();
//$(".nav_box").animate({"padding-bottom":$this_ulhei+"px"});
};
};
};
});
}
function FunNavigation2(Series,ClassName,Lab,PosiTion){ /*Series 1为一级栏目 分类 2为二级栏目 分类*/
switch(Series)
{
case 1:
if(jQuery("."+ClassName).size()>0){
var navigation = responsiveNav("."+ClassName+"",{ // Selector: The ID of the wrapper
animate: true, // Boolean: 是否启动CSS过渡效果(transitions), true 或 false
transition: 0, // Integer: 过渡效果的执行速度,以毫秒(millisecond)为单位
label: "<i class='iconfont'>"+Lab+"</i>", // String: Label for the navigation toggle
insert: "after", // String: Insert the toggle before or after the navigation
customToggle: "", // Selector: Specify the ID of a custom toggle
openPos: PosiTion, // String: Position of the opened nav, relative or static
jsClass: "js", // String: 'JS enabled' class which is added to <html> el
debug: false, // Boolean: Log debug messages to console, true 或 false
init: function(){}, // Function: Init callback
open: function(){}, // Function: Open callback
close: function(){} // Function: Close callback
});
}
break;
case 2:
if(jQuery("."+ClassName).size()>0){
jQuery("."+ClassName).children("ul").children("li").children("ul").each(function(i){
jQuery(this).addClass(ClassName+i);
var navigation = responsiveNav("."+ClassName+i,{ // Selector: The ID of the wrapper
animate: true, // Boolean: 是否启动CSS过渡效果(transitions), true 或 false
transition: 0, // Integer: 过渡效果的执行速度,以毫秒(millisecond)为单位
label: "<i class='iconfont'>"+Lab+"</i>", // String: Label for the navigation toggle
insert: "after", // String: Insert the toggle before or after the navigation
customToggle: "", // Selector: Specify the ID of a custom toggle
openPos: PosiTion, // String: Position of the opened nav, relative or static
jsClass: "js", // String: 'JS enabled' class which is added to <html> el
debug: false, // Boolean: Log debug messages to console, true 或 false
init: function(){}, // Function: Init callback
open: function(){}, // Function: Open callback
close: function(){} // Function: Close callback
});
});
};
break;
}
}
function WowS(BoxClassName,Fadehdfx){ /*首页滑动效果*/
var wow = new WOW({
boxClass:BoxClassName,
animateClass:'animated '+Fadehdfx,
offset:0,
mobile: true,
live: true
});
wow.init();
}
function Wows(classname,hdclassname,cout)/*classname执行动画元素 hdclassname执行动画的方式 cout 每行排几个*/
{
var $classname=jQuery("."+classname);
$classname.each(function(i){
if(i%cout==0){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/0.2s"});}
else if(i%cout==1){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/0.4s"});}
else if(i%cout==2){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/0.6s"});}
else if(i%cout==3){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/0.8s"});}
else if(i%cout==4){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/0.9s"});}
else if(i%cout==5){jQuery(this).attr({"data-wow-delay":"1s"});}
else if(i%cout==6){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/1.1s"});}
else if(i%cout==7){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/1.2s"});}
else if(i%cout==8){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/1.3s"});}
else if(i%cout==9){jQuery(this).attr({"data-wow-delay":"http://www.580web.cn/p519/Skin/p519/js/1.4s"});}
});
var wow = new WOW({
boxClass:classname,
animateClass: 'animated '+hdclassname,
offset: 80,
mobile: true,
live: true
});
wow.init();
}
function ShowSubMenu(id) //显示下拉
{
var $Menu=jQuery("#Menu");
if($Menu.size()!=1){return;}
var $MenuItem=$Menu.children("ul").children("li");
var $CurrentMenuItem=jQuery("#MenuItem"+id);
if($MenuItem.size()<=1){return;}
if(typeof(submenu_style)=="undefined")
{
submenu_style=1; //1表示纵向下拉,2表示横向下拉,0则关闭
}
var classname="menu_current";
switch(submenu_style)
{
case 2:
$MenuItem.children("ul").hide();
document.write('<link rel="stylesheet" type="text/css" href="http://t.shpanyou.com/wp-content/themes/mbpanyou/css/moban1/submenu.css"/*tpa=http://www.580web.cn/p519/skin/p519/css/submenu.css*/ />');
$CurrentMenuItem.children("ul").show();
$CurrentMenuItem.addClass(classname).siblings().removeClass(classname);
$MenuItem.mouseenter(function(){jQuery(this).addClass(classname).children("ul").show();jQuery(this).siblings().removeClass(classname).children("ul").hide();});
break;
case 1:
var ck_widths=document.documentElement.clientWidth;
document.write('<link rel="stylesheet" type="text/css" href="http://t.shpanyou.com/wp-content/themes/mbpanyou/css/moban1/dropmenu.css"/*tpa=http://www.580web.cn/p519/skin/p519/css/dropmenu.css*/ />');
function Dhxl(ck_widths)
{
$MenuItem.children("ul").hide();
$MenuItem.mouseenter(function(){jQuery(this).addClass(classname).siblings().removeClass(classname);});
$MenuItem.mouseleave(function(){jQuery(this).removeClass(classname);});
$MenuItem.mouseenter(function(){jQuery(this).children("ul").stop().slideDown("fast");});
$MenuItem.mouseleave(function(){jQuery(this).children("ul").stop().slideUp("fast");});
if(typeof(Lanmu_Id)!="undefined")
{
$Menu.bind('mouseleave',function(){$CurrentMenuItem.addClass(classname);});
}
};
if (document.documentMode <=8)
{
}
else
{
if(ck_widths>=1000){Dhxl();}else{$MenuItem.unbind();$MenuItem.children("ul").show();};
jQuery(window).resize(function(){
// jQuery(".nav-toggle").remove();
var ck_width=document.documentElement.clientWidth;
if(ck_width>=1000){Dhxl();}
else
{
$MenuItem.unbind();
$MenuItem.children("ul").show();
$Menu.children("ul").children("li").each(function(i){
$Menu.children("ul").children("li").eq(i).children("ul").css({"height":"auto"});
});
};
});
}
break;
}
}
//无下拉的菜单取消hover样式
jQuery(function(){
var $menuli=jQuery("#Menu").children("ul").children("li");
if($menuli.size()==0){return;}
$menuli.bind('mouseenter',function(){
if(jQuery(this).children("ul").size()==0)
{
jQuery(this).removeClass("hover");
}
});
});
//右侧返回顶部图标
jQuery(function(){
var icon='<a class="gotoptop_icon" id="gotoptop_icon" href="#" title="返回顶部"></a>';
jQuery("body").append(icon);
var $window=jQuery(window);
var $gotoptop_icon=jQuery("#gotoptop_icon");
var $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? jQuery('html') : jQuery('body')) : jQuery('html,body'); // opera fix
jQuery(window).bind('scroll resize',function(){
if($window.scrollTop()>0)
{
$gotoptop_icon.show();
}
else
{
$gotoptop_icon.hide();
}
});
$gotoptop_icon.bind('click',function(){
$body.animate({scrollTop:'0px'},"fast");
return false;
});
});
function goto(id)
{
var pos=0;
var obj=jQuery(id);
if(obj.size()==0){return;}
pos=obj.offset().top;
pos=pos-137;
var $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? jQuery('html') : jQuery('body')) : jQuery('html,body'); // opera fix
$body.animate({scrollTop:pos+'px'});
}