Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <title> FireFox Scroll Issue </title>
- </head>
- <body>
- <div id="select_div" style="display: none;">
- <select>
- <option value="1">1</option>
- </select>
- </div>
- <script>
- for ( var i = 0; i < 300; i++ ) document.write( '<p>' + i + '</p>' );
- function Scroller()
- {
- var self = this;
- this.si = null;
- this.old_scroll_pos = null;
- this.select_visible = false;
- this.select_div = document.getElementById( 'select_div' );
- window.onscroll = function(){ self.SetScrolling(); }
- }
- Scroller.prototype.SetScrolling = function()
- {
- var self = this;
- this.scroll_pos = document.body && document.body.scrollTop || document.documentElement && document.documentElement.scrollTop || 0 ;
- if ( !this.si ) this.si = setInterval( function(){ self.Poll_Scroll_Pos(); }, 10 );
- }
- Scroller.prototype.Poll_Scroll_Pos = function()
- {
- if ( this.old_scroll_pos == this.scroll_pos )
- {
- clearInterval( this.si );
- this.si = null;
- }
- this.old_scroll_pos = this.scroll_pos;
- if ( this.scroll_pos > 300 && this.select_visible == false )
- {
- this.select_div.style.display = 'block';
- this.select_visible = true;
- }
- if ( this.scroll_pos == 0 && this.select_visible == true )
- {
- this.select_div.style.display = 'none';
- this.select_visible = false;
- }
- }
- var scroller = new Scroller();
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment