Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add background moving image animation
- <div class="admin_area"></div> call this into body tag
- *****************************************************************************
- call this into head tag
- <script type="text/javascript">
- // speed in milliseconds
- var scrollSpeed = 70;
- // set the default position
- var current = 0;
- // set the direction
- var direction = 'h';
- function bgscroll(){
- // 1 pixel row at a time
- current -= 1;
- // move the background with backgrond-position css properties
- $('div.admin_area').css("backgroundPosition", (direction == 'h') ? current+"px 0" : "0 " + current+"px");
- }
- //Calls the scrolling function repeatedly
- setInterval("bgscroll()", scrollSpeed);
- </script>
- <style type="text/css">
- .admin_area {background:#3e83c8 url(http://www.queness.com/resources/html/bgscroll/images/bg_clouds.png);background-size:cover;}
- </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement