Hey all, I would consider myself an intermediate jQuery developer. I'm
building a new site and as part of it, there's a lot of a jQuery code
I wrote to handle animations and other interface elements of the site.
In Safari, I'm getting thrown a SyntaxError with no line number when
the clickDo(); and clickUndo(); functions run. Additionally, I wanted
to see if anyone knew how to prevent those same functions from firing
if someone say, clicks the trigger object a bunch of times.

Here's the code in question:

$(document).ready(function(){

        function clickUndo() {
                $(".toggle").bind('click',function() {
                        var togLink = $(this).attr("rel");
                        var togText = $(this).attr("title");
                        $(togLink).fadeOut();
                        $("#header").animate({ width: '200px' }, 500, 
'easeInBack', function
() {
                                $("#main").fadeTo(350, 1);
                        });
                        $("#nav ul li").not($(this).parent()).animate({ left: 
'0px' }, 500,
'easeOutExpo');
                        $(this).removeClass("expanded")
                                   .html(togText)
                           .unbind('click');
                        clickDo();
                });
        }
        function clickDo() {
                $(".toggle").bind('click',function() {
                        var togLink = $(this).attr("rel");
                        $(togLink).fadeIn();
                        $("#main").fadeTo(300, 0.35, function() {
                                $("#header").animate({ width: '835px' }, 500, 
'easeOutExpo');
                        });
                        $("#nav ul li").not($(this).parent()).animate({ left: 
'-850px' },
500, 'easeOutExpo');
                        $(this).addClass("expanded")
                                   .html('Close <img 
src="http://specik.theatypical.net/wp-content/
themes/smoke/img/ico_close.png" class="ico" />')
                                   .unbind('click');
                        clickUndo();
                });
        }

        clickDo();
});

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to