var is_have_pushnews = false; var leftPopup=''; var bottomPopup='';bottomPopup=''; if (bottomPopup != '') { is_have_pushnews = true; } $(document).ready(function() { $('').appendTo('body'); var leftBlock = $('
'); if (leftPopup != '') { $(leftPopup).appendTo(leftBlock); $(leftBlock).appendTo('body'); var tmpid = $(this).attr('datatag'); $(".left_tj").click(function(){ storage.set('footerState_'+tmpid, tmpid); TA.log({id:'zx_lefttj',fid:'Popup',_sid:'zx_pu_ta'}); }); } var bottomBlock = $(''); if (bottomPopup != '') { var bottomPopFlag = 'footerState_'; var tmpid = $(this).attr('datatag'); if (!storage.get(bottomPopFlag)) { $(bottomPopup).appendTo(bottomBlock); $(bottomBlock).appendTo('body'); $(".bottom_tj").click(function(){ storage.set('footerState_'+tmpid, tmpid); TA.log({id:'zx_bottomtj',fid:'Popup',_sid:'zx_pu_ta'}); }); } } function getSize() { var height = document.documentElement.clientHeight; var width = $(document).width(); var itemLeft = $(".dialog-left"); var itemBottom = $(".dialog-bottom"); itemLeft.css("top", (height - itemLeft.height()) / 2); itemBottom.css("left", (width - itemBottom.width()) / 2); } function clickOpe() { if (leftPopup != '') { var aim = $(".dialog-left").find(".item"); $.each(aim, function(index, value) { $(value).mouseenter(function() { var content = $(this).find(".item-content"); if (content.hasClass("hide")) { content.removeClass("hide"); $(value).removeClass("roundbac"); } }); $(value).find(".item-content").find(".close").on("click", function() { var content = $(value).find(".item-content"); $(content).addClass("hide"); $(value).addClass("roundbac"); //for IE 6,7,8hack }); }); } } //给弹窗定位 getSize(); clickOpe(); //鼠标放上去显示相应的弹窗 if (bottomPopup != '') { var box = $(".dialog-bottom").find(".box"); $.each(box, function(index, value) { var timer; var flag = true; $(value).unbind("mouseenter"); $(value).mouseenter(function() { clearTimeout(timer); var text = $(value).find(".text"); var icon = $(value).find(".icon"); if (flag) { text.css("white-space", "normal"); icon.animate({ "margin-top": "25px" }); $(value).css({"height":"88px","overflow":"inherit"}); flag = false; } $(value).find("a.close").removeClass('hide').click(function(){ $(value).addClass("hide"); }); }); $(value).unbind("mouseleave"); $(value).mouseleave(function() { $(value).find("a.close").addClass("hide"); timer = setTimeout(function() { $(value).addClass("hide"); }, 60000); }); }); } setTimeout(function(){getSize();},500); setTimeout(function(){ $(".dialog-left").hide(); },600000); setTimeout(function(){ $(".dialog-bottom").hide(); },300000); $(window).resize(function() { getSize(); }); });