Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- always keep the window in the center when move the scroll bar
- <style>
- #Window {
- display: none;
- text-align: center;
- border: 1px solid #333;
- position:absolute;
- width: 200px;
- height: 80px;
- z-index:9999;
- background:#fff;
- border-radius: 5px;
- padding: 10px;
- }
- </style>
- <script>
- $("#window").css('top', 200);
- $("#window").css('left', winW/2- $("#window").width());
- $(window).scroll(function () {
- var winH = $(window).height();
- setTimeout( function(){
- $('#alertWindow').animate({'top':winH/2-$("#window").height()/2},200);
- }, 1000);
- });
- </script>
- <div id="window">this is scroll window</div>
- $( ".myDialogWindow" ).dialog( "option", "position", 'center' );
Add Comment
Please, Sign In to add comment