Jquery弹出框以及跟随页面滚动

http://blog.163.com/serena_lxj/blog/static/12382348020112714951735/

<link rel="stylesheet" href="http://www.cnnauto.com/2011cnnauto/css/jquery-ui.css" type="text/css" media="all" />
<script src="http://www.cnnauto.com/2011cnnauto/js/jquery.min.js" type="text/javascript"></script>
<script src="http://www.cnnauto.com/2011cnnauto/js/jquery-ui.min.js" type="text/javascript"></script>
<SCRIPT>
$(function() {
  $( "#dialog" ).dialog({ width:625,position:'bottom',zIndex:9999});
});
  $(window).scroll(function(){
  $('.ui-dialog').css('top', $(document).scrollTop() + $(window).height() - $('.ui-dialog').height());});

</SCRIPT>
<style>
.ui-draggable .ui-dialog-titlebar {width:96%;float:left;clear:both;}
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon,.ui-widget-header .ui-icon,.ui-icon { background-image:url(/2011cnnauto/images/close.gif);}
.ui-icon{ width:50px; height:26px;}
.ui-dialog .ui-dialog-titlebar-close{ width:50px; height:25px;margin: -15px 0 0;}
.ui-icon-closethick { background-position:10px 50%;}
</style>
<div class="demo">
<div id="dialog" title='007特别版 奔驰威霆VITO和奔驰雅诺VIANO'>
<p>
<a href="http://www.cnnauto.com/homeindex/index/sjzx/241350.shtml" target="_blank">
<img src='007.jpg' border="0"/>
</a>
</p>
</div>
</div>
页面效果图:

Jquery弹出框以及跟随页面滚动 - serena_lxj - serena_lxj的博客



 

posted @ 2012-09-25 13:29  y0umer  阅读(423)  评论(0编辑  收藏  举报