Skip to content

Instantly share code, notes, and snippets.

@huobazi
Forked from huacnlee/bottom_pop_window.js
Created May 16, 2011 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huobazi/973837 to your computer and use it in GitHub Desktop.
Save huobazi/973837 to your computer and use it in GitHub Desktop.
页面底部弹窗广告
// jQuery need
setTimeout(showBTW, 1000);
function showBTW(){
$("body").append('<div class="bottom_pop_window">\
<div class="title">热门推荐<a href="#" onclick="return closeBTW();" class="close">关闭</a></div> \
<iframe src="/btw" frameborder="no"></iframe></div>');
$(".bottom_pop_window").css("bottom",-140).animate({ bottom : 10 });
}
function closeBTW(){
$(".bottom_pop_window").hide();
return false;
}
// CSS
.bottom_pop_window {float: right;position: fixed;bottom: 10px;right: 10px;width: 300px;
height: 166px; border:1px solid #a31a40; padding:1px;background: #FFF;}
.bottom_pop_window .title { background:#d35a20; color:#FFF; padding:2px 6px; font-weight:bold; }
.bottom_pop_window .title a.close { float:right; font-size:12px; font-weight:normal; color:#FFF; }
.bottom_pop_window iframe { width: 300px; overflow:hidden; height:140px;}
* html .bottom_pop_window{position: absolute;
top: expression(offsetParent.scrollTop+document.documentElement.clientHeight-this.offsetHeight);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment