当前位置: 代码迷 >> Web前端 >> 右上角
  详细解决方案

右上角

热度:235   发布时间:2012-08-29 08:40:14.0
右下角
<input id="idBoxOpen2" value=" 右下角弹窗效果 " type="button" />
<dl id="idBox2" class="lightbox">
<dt><strong>右下角消息框</strong>
<dd><input id="idBoxClose2" value=" 下滚渐隐 " type="button" /> </dd></dl>
<script>
(function(){
//右下角消息框
var timer, target, current,
xx = new AlertBox( "idBox2", { fixed: true,
  onShow: function(){
   clearTimeout(timer); this.box.style.bottom = this.box.style.right = 0;
  },
  onClose: function(){ clearTimeout(timer); }
});
function hide(){
xx.box.style.bottom = --current + "px";
if( current <= target ){
  xx.close();
} else {
  timer = setTimeout( hide, 10 );
}
}
$$("idBoxClose2").onclick = function(){
target = -xx.box.offsetHeight; current = 0; hide();
}
$$("idBoxOpen2").onclick = function(){ xx.show(); }
})()
</script>
  相关解决方案