jquery(function(){ //图库弹出层 $(".xn_c_honor_4_mskelaybg").height($(document).height()); $(".xn_c_honor_4_mskeclaose").click(function(){$(".xn_c_honor_4_mskelaybg,.xn_c_honor_4_mskelaybox").hide()}); $(".xn_c_honor_4_mskeimgbox li").click(function(){$(".xn_c_honor_4_mske_html").html($(this).find(".xn_c_honor_4_hidden").html()); $(".xn_c_honor_4_mskelaybg").show();$(".xn_c_honor_4_mskelaybox").fadein(300)}); $(".xn_c_honor_4_msketogbtn").click(function(){$(".xn_c_honor_4_mskeimgbox").toggleclass("xn_c_honor_4_mskeimgbox2"); $(this).toggleclass("xn_c_honor_4_msketogbtn2")}); }) $(function(){ var warp = $(".xn_f_19_wrap"); var sel = $(".xn_f_19_sel"); var seli = $(".xn_f_19_sel li"); var lktxt = $(".xn_f_19_lktxt"); var lkbtn = $(".xn_f_19_lkbtn"); var warph = warp.outerheight(); //获取盒子自身高度 var selht = sel.find("ul").outerheight(); var showmenu = true; var speed = 800; sel.css("height","0"); lktxt.html($(".xn_f_19_lkname").html()); $(".xn_f_19_lktxt,.xn_f_19_lkbtn").click(function(e){ //var wtop = document.getelementbyid("xn_f_19").offsettop; var wtop = warp.offset().top; //获取友情链接当前盒子距离页面顶部的距离 var scrolltop = $(window).scrolltop(); //获取滚动条距离顶部的距离 var widh = $(window).height(); //获取浏览器可视区域高度 var toph = wtop-scrolltop; //得到盒子距离浏览器可视区域上方的距离 var both = widh-toph-warph; //得到盒子距离浏览器可视区域上方的距离 if(showmenu){ warp.css("overflow","inherit"); if(toph > both){ sel.find("ul").addclass("xn_f_19_ul_topb").removeclass("xn_f_19_ul_botb"); sel.animate({"height":selht,"top":-(selht-1)},speed,function(){ showmenu = false; }); }else{ sel.find("ul").addclass("xn_f_19_ul_botb").removeclass("xn_f_19_ul_topb"); sel.stop(false,true).animate({"height":selht},speed,function(){ showmenu = false; }); } }else{ sel.stop(false,true).animate({"height":"0","top":warph},speed,function(){ showmenu = true; }); } e.stoppropagation(); //清除事件 }); seli.click(function(){ lktxt.html($(this).find(".xn_f_19_name").html()); $(this).addclass("xn_f_19_on").siblings().removeclass("xn_f_19_on"); sel.stop(false,true).animate({"height":"0","top":warph},speed); showmenu = true; }); $(document).click(function(){ sel.stop(false,true).animate({"height":"0","top":warph},speed); showmenu = true; }); }); $(function(){ var warp = $(".xn_f_20_wrap"); var sel = $(".xn_f_20_sel"); var seli = $(".xn_f_20_sel li"); var lktxt = $(".xn_f_20_lktxt"); var lkbtn = $(".xn_f_20_lkbtn"); var warph = warp.outerheight(); //获取盒子自身高度 var selht = sel.find("ul").outerheight(); var showmenu = true; var speed = 800; sel.css("height","0"); lktxt.html($(".xn_f_20_lkname").html()); $(".xn_f_20_lktxt,.xn_f_20_lkbtn").click(function(e){ //var wtop = document.getelementbyid("xn_f_20").offsettop; var wtop = warp.offset().top; //获取友情链接当前盒子距离页面顶部的距离 var scrolltop = $(window).scrolltop(); //获取滚动条距离顶部的距离 var widh = $(window).height(); //获取浏览器可视区域高度 var toph = wtop-scrolltop; //得到盒子距离浏览器可视区域上方的距离 var both = widh-toph-warph; //得到盒子距离浏览器可视区域上方的距离 if(showmenu){ warp.css("overflow","inherit"); if(toph > both){ sel.find("ul").addclass("xn_f_20_ul_topb").removeclass("xn_f_20_ul_botb"); sel.animate({"height":selht,"top":-(selht-1)},speed,function(){ showmenu = false; }); }else{ sel.find("ul").addclass("xn_f_20_ul_botb").removeclass("xn_f_20_ul_topb"); sel.stop(false,true).animate({"height":selht},speed,function(){ showmenu = false; }); } }else{ sel.stop(false,true).animate({"height":"0","top":warph},speed,function(){ showmenu = true; }); } e.stoppropagation(); //清除事件 }); seli.click(function(){ lktxt.html($(this).find(".xn_f_20_name").html()); $(this).addclass("xn_f_20_on").siblings().removeclass("xn_f_20_on"); sel.stop(false,true).animate({"height":"0","top":warph},speed); showmenu = true; }); $(document).click(function(){ sel.stop(false,true).animate({"height":"0","top":warph},speed); showmenu = true; }); }); $(function(){ var warp = $(".xn_f_21_wrap"); var sel = $(".xn_f_21_sel"); var seli = $(".xn_f_21_sel li"); var lktxt = $(".xn_f_21_lktxt"); var lkbtn = $(".xn_f_21_lkbtn"); var warph = warp.outerheight(); //获取盒子自身高度 var selht = sel.find("ul").outerheight(); var showmenu = true; var speed = 800; sel.css("height","0"); lktxt.html($(".xn_f_21_lkname").html()); $(".xn_f_21_lktxt,.xn_f_21_lkbtn").click(function(e){ //var wtop = document.getelementbyid("xn_f_21").offsettop; var wtop = warp.offset().top; //获取友情链接当前盒子距离页面顶部的距离 var scrolltop = $(window).scrolltop(); //获取滚动条距离顶部的距离 var widh = $(window).height(); //获取浏览器可视区域高度 var toph = wtop-scrolltop; //得到盒子距离浏览器可视区域上方的距离 var both = widh-toph-warph; //得到盒子距离浏览器可视区域上方的距离 if(showmenu){ warp.css("overflow","inherit"); if(toph > both){ sel.find("ul").addclass("xn_f_21_ul_topb").removeclass("xn_f_21_ul_botb"); sel.animate({"height":selht,"top":-(selht-1)},speed,function(){ showmenu = false; }); }else{ sel.find("ul").addclass("xn_f_21_ul_botb").removeclass("xn_f_21_ul_topb"); sel.stop(false,true).animate({"height":selht},speed,function(){ showmenu = false; }); } }else{ sel.stop(false,true).animate({"height":"0","top":warph},speed,function(){ showmenu = true; }); } e.stoppropagation(); //清除事件 }); seli.click(function(){ lktxt.html($(this).find(".xn_f_21_name").html()); $(this).addclass("xn_f_21_on").siblings().removeclass("xn_f_21_on"); sel.stop(false,true).animate({"height":"0","top":warph},speed); showmenu = true; }); $(document).click(function(){ sel.stop(false,true).animate({"height":"0","top":warph},speed); showmenu = true; }); });