$(function(){ $("#holidayTopRight > div").mouseover(function(){ $("#holidayTopRight > div").removeClass("active"); $(this).addClass("active"); var str = $(this).html(); $("#holidayTopImage > img").attr("alt",str); }); }); TrunMenu("toptour_type","active","li","toptype_content"); TrunMenu("toptour_type2","active","li","toptype_content2"); TrunMenu("toptour_type3","active","li","toptype_content3"); TrunMenu("toptour_type4","active","li","toptype_content4"); TrunMenu("toptour_type5","active","li","toptype_content5"); TrunMenu("toptour_type6","active","li","toptype_content6"); function tourfilter(t,o){ $(".bartitle").addClass("bartitleblur"); $(".tour").hide(); $('#'+t).show(); $("#sideBarLeft li a").removeClass("activeli") $(o).addClass("activeli") } function selectTab(o,sid){ $(".ideamonthcont").hide(); $(".ideamonthul a").removeClass("actives"); $('#'+sid).show(); $(o).addClass("actives"); } $(function(){ var ma_default = {anchortag: "href", anchorSmooth: true}; $(".top").mAnchor(ma_default); $(".promotion").mAnchor(ma_default); $(".classic").mAnchor(ma_default); $(".intrest").mAnchor(ma_default); $(".type").mAnchor(ma_default); $(".price").mAnchor(ma_default); $(".stopover").mAnchor(ma_default); $(".wild").mAnchor(ma_default); $(".beyond").mAnchor(ma_default); var sTags = $("#sideBarLeft"); sTags_top = sTags.offset().top; $(window).unbind("scroll"); $(window).bind("scroll", function() { try{ var tab_promotion = $("#promotion + div").eq(0); var tab_classic = $("#classic + div").eq(0); var tab_intrest = $("#intrest + div").eq(0); var tab_type = $("#type + div").eq(0); var tab_price = $("#price + div").eq(0); var tab_stopover = $("#stopover + div").eq(0); var tab_wild = $("#wild + div").eq(0); var tab_beyond = $("#beyond + div").eq(0); var self_top = $(this).scrollTop(); if( self_top > sTags_top ){ sTags.css({"position": "fixed", "top": 0, "z-index": 10}); if(self_top > tab_promotion.offset().top - 10 && tab_promotion.offset().top != 0){ changingOverTab($("#sideBarLeft .promotion")); } if(self_top > tab_classic.offset().top - 10 && tab_classic.offset().top != 0){ changingOverTab($("#sideBarLeft .classic")); } if(self_top > tab_intrest.offset().top - 10 && tab_intrest.offset().top != 0){ changingOverTab($("#sideBarLeft .intrest")); } if(self_top > tab_type.offset().top - 10 && tab_type.offset().top != 0){ changingOverTab($("#sideBarLeft .type")); } if(self_top > tab_price.offset().top - 10 && tab_price.offset().top != 0){ changingOverTab($("#sideBarLeft .price")); } if(self_top > tab_stopover.offset().top - 10 && tab_stopover.offset().top != 0){ changingOverTab($("#sideBarLeft .stopover")); } if(self_top > tab_wild.offset().top - 10 && tab_wild.offset().top != 0){ changingOverTab($("#sideBarLeft .wild")); } if(self_top > tab_beyond.offset().top - 10 && tab_beyond.offset().top != 0){ changingOverTab($("#sideBarLeft .beyond")); } }else{ sTags.css({"position": "static", "background": "none"}); changingOverTab($("#sideBarLeft .promotion")); } }catch(err){} }); }); function changingOverTab(o) { var a_current = o; var a_parent = a_current.parent(); var a_current_name = a_current.attr("class"); a_parent.siblings().each(function(){ var sibling = $(this).find("a"); var sibling_name = sibling.attr("class"); if(testReg(/activeli/, sibling_name)){ sibling.removeClass('activeli'); } }); if(testReg(/activeli/, a_current_name)){ }else{ a_current.addClass("activeli"); } } function testReg(reg,str){ return reg.test(str); }