Skip to main content

Bug Tracker

Side navigation

Ticket #3583: recursion-animation.html
File recursion-animation.html, 1.1 KB (added by adrien.gibrat, November 08, 2008 01:55PM UTC)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR">
<head profile="http://gmpg.org/xfn/11">
	<title>Test case: too much recursion with animation</title>
    <script type="text/javascript" src="http://jquery.com/src/_jquery-latest.js"></script>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
        $.fn.fixedScroll = function(speed, easing, callback){
            var self    = this.css('position', 'relative'),
                animate = $.extend({queue: false}, $.speed(speed, easing, callback));
            $(document).scroll(function(){
                self.animate({top: $(this).scrollTop()}, animate);// this will bug "too much recursion" 
                //self.animate({top: $(this).scrollTop()}, $.extend({}, animate));// this works... 
            });
        }
        $(function(){
            $('#fixed').fixedScroll();
        });
    </script>
</head>
<body>
    <div style="height:2000px"><p id="fixed">this text should scroll with the page</p></div>
</body>
</html>

Download in other formats:

Original Format