Programming in javascript: cross-browser compatibility on newest questions tagged javascript – Stack Overflow

On the new safari browser 6.0 on Lion 10.8 this code is not executing properly. Works fine in firefox and iPad safari. But on the mac it keeps vibrating as I scroll up and down. I’m trying to keep the top banner scrolling until the button reach the top of the page at which point i want the buttons to stay fixed.

here’s the link to the page:

http://www.persiantunedpiano.com/Mirror/events.htm

here’s the js:

<script type="text/javascript">
<![CDATA[

  $(document).scroll(function() {var scrollTop = $(window).scrollTop();
                        scroll(0, scrollTop);
                        if (scrollTop > 189) {
                            //alert(scrollTop);
                            $('#top_links').css('position', 'fixed');
                            $('#top_links').css('top', '0');
                            $('#left_links').css('position', 'fixed');
                            $('#left_links').css('top', '57px');

                        } else {
                            //alert('2');

                            $('#top_links').css('position','absolute');
                            $('#top_links').css('top', '186px');
                            $('#left_links').css('position', 'absolute');
                            $('#left_links').css('top', '242px');
                            //allertSize();
                        }
                        });

//]]>
</script>

See Answers


source: http://stackoverflow.com/questions/11924490/cross-browser-compatibility
Programming in javascript: programming-in-javascript



online applications demo