(function ($) { if (!!window.activexobject && !window.xmlhttprequest && (location.href=='http://www.lanrentuku.com' || location.href=='http://www.lanrentuku.com/')) return; $(function () { nav(); bnrsilder(); sideslider(); helptoggle(); systole(); slideimg(); downm(); extmutual(); slides("#slides", ".slides"); skinmutual(); srolllist("#dialog01", "11"); srolllist("#dialog02", "6"); anchorlink(); var img = document.createelement("img"); img.onload = function() { window.onload = function () { skinshow(); }; }; }); //滚动 function nav() { var $licur = $(".nav-box ul li.cur"), curp = $licur.position().left, curw = $licur.outerwidth(true), $slider = $(".nav-line"), $targetele = $(".nav-box ul li:not('.last') a"), $navbox = $(".nav-box"); $slider.stop(true, true).animate({ "left":curp, "width":curw }); $targetele.mouseenter(function () { var $_parent = $(this).parent(), _width = $_parent.outerwidth(true), posl = $_parent.position().left; $slider.stop(true, true).animate({ "left":posl, "width":_width }, "fast"); }); $navbox.mouseleave(function (cur, wid) { cur = curp; wid = curw; $slider.stop(true, true).animate({ "left":cur, "width":wid }, "fast"); }); } ; //滚动 function bnrsilder() { if (!$("#head").length && !$("#bnr").length) { return; } (function () { if (navigator.useragent.tolocalelowercase().indexof('opera') >= 0) return; var sstag = document.createelement('script'); sstag.type = 'text/javascript'; sstag.async = true; sstag.src = 'script/smoothscroll.js'; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(sstag, s); })(); $(window).scroll(function () { var btop = $(this).scrolltop(); $('.bnr-box').css({ 'margin-top':-btop * 0.48 }); $('.bnr-txt').css({ 'margin-top':-btop * 0.68 }); $('.bnr-btn').css({ 'margin-top':-btop * 0.68 }); $('.warper').css({ "background-position":"50% " + btop * 0.2 + "px" }); if (btop < 200) { $(".txt-warp").css({ 'margin-top':-btop * 1.5 }); $(".txt-nav-warp").removeattr("style"); } else { $(".txt-warp").css({ 'margin-top':-240 }); $(".txt-nav-warp").css({ "position":"fixed", "top":0, "left":0, "box-shadow":"0 2px 6px #eee" }); } var idxs = 0; if (btop >= 200 && btop < 577) { idxs; } else if (btop >= 577 && btop < 1072) { idxs = 1; } else if (btop >= 1072 && btop < 1165) { idxs = 2; } else if (btop >= 1165) { idxs = 3; } $('.txt-nav li a').eq(idxs).addclass('on').parent().siblings().children().removeclass ('on'); if (btop < 200) { $('.txt-nav li a').removeclass('on'); } }); }; function sideslider() { if (!$(".help-side dl").length) { return false; } var $acur = $(".help-side dl").find(".cur a"), $targeta = $(".help-side dl dd a"), $sidesilder = $(".side-slider"), curt = $acur.position().top - 3; $sidesilder.stop(true, true).animate({ "top":curt }); $targeta.mouseenter(function () { var post = $(this).position().top - 3; $sidesilder.stop(true, true).animate({ "top":post }, 240); }).parents(".help-side").mouseleave(function (_curt) { _curt = curt $sidesilder.stop(true, true).animate({ "top":_curt }); }); } ; function helptoggle() { if (!$(".help-cont dl dt a").length) { return; } var $targetele = $(".help-cont dl dt a"); $targetele.toggle(function () { $(this).parent().css({ "background-position":"0 -20px" }).siblings().slidedown(); return false; }, function () { $(this).parent().removeattr("style").siblings().slideup(); return false; }); } ; function systole() { if (!$(".history").length) { return; } var $warpele = $(".history-date"), $targeta = $warpele.find("h2 a,ul li dl dt a"), parenth, eletop = []; parenth = $warpele.parent().height(); $warpele.parent().css({ "height":59 }); settimeout(function () { $warpele.find("ul").children(":not('h2:first')").each(function (idx) { eletop.push($(this).position().top); $(this).css({ "margin-top":-eletop[idx] }).children().hide(); }).animate({ "margin-top":0 }, 1600).children().fadein(); $warpele.parent().animate({ "height":parenth }, 2600); $warpele.find("ul").children(":not('h2:first')").addclass("bounceindown").css({ "-webkit-animation-duration":"2s", "-webkit-animation-delay":"0", "-webkit-animation-timing-function":"ease", "-webkit-animation-fill-mode":"both" }).end().children("h2").css({ "position":"relative" }); }, 600); $targeta.click(function () { $(this).parent().css({ "position":"relative" }); $(this).parent().siblings().slidetoggle(); $warpele.parent().removeattr("style"); return false; }); } ; })(jquery);