Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caught in an infinite loop / Why?

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
Can you please tell me why this causes my page to get caught in an infinite loop?
Code:
    $( "#menu-team" ).click(function() {
        $( "#main-container" ).animate({
            opacity: 0.25,
            left: "+=50",
            height: "toggle"
        }, 3000, function() {
            // Animation complete.
            $("#main-container").html($("#team-page").html());
            $("#main-container").animate({
                opacity: 1,
                left: "+=50",
                height: "toggle"
            }, 2000, function() {
                // Animation complete.

            });

        });
    });

I open the console but no errors, warnings ...

As usual, your assistance is greatly appreciated.



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
As usual, I post the question and shortly after, I come up with the answer ...

I also have
Code:
$( "document" ).ready(function() {});
listener and the originally posted snippets triggers it after the automation; goes to show that you learn something new every day.

I solved it by setting a variable and checking if set so that on ready only runs once. If I ever need to run it again, reset variable and off it goes.

Thanks!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top