Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2009
    Posts
    77
    Thanks
    2
    Thanked 0 Times in 0 Posts

    jquery queueing help!

    my new website uses jquery! but its buggy and i need help!
    http://patrickallard.net63.net/
    here is the part of the code with the error, its denoted by
    // error here
    when i try to append the openHopin function it doesn't work, if i try to run it strait up with $(this).openHopin it does work.
    but i have to append it because i have to queue it, i cant queue it unless i append it right?
    not that this is just a code snippet for conciseness purposes, it wont run at all on its own, view the website link and look at the bottom of the page for the full jquery script
    tyvm love u guys!
    Code:
    (function() {
    	// function to open or close a window
    	$.fn.OpenToggle = function(binaryBool,row,col,itemWidth,itemHeight,numRows,openHeight,speed,fn) 
    	{
    		//if its open close it
    		if(window[binaryBool])
    		{
    			window[binaryBool]=false;
    			
    			var itemLeft=col*parseInt(itemWidth)
    			var itemTop=row*parseInt(itemHeight)
    			
    			return $(this).animate({
    				'height': itemHeight+'px',
    			}, speed || 400, function() {
    				$.isFunction(fn) && fn.call(this);
    			}).animate({
    				'left': itemLeft+'px',
    				'width': itemWidth+'px',
    			}, speed || 400, function() {
    				$.isFunction(fn) && fn.call(this);
    			}).animate({
    				'top': itemTop+'px',
    			}, speed || 400, function() {
    				$.isFunction(fn) && fn.call(this);
    			});
    		}
    		// if its closed open it
    		else
    		{
    			// close other windows if they are open
    			// error here
    			if(experienceOpen)
    				experience.OpenToggle("experienceOpen",0,0,300,sampleItemHeight,2,experienceHeight,500).OpenHopin;
    			if(educationOpen)
    				education.OpenToggle("educationOpen",0,1,300,sampleItemHeight,2,educationHeight,500).OpenHopin;
    			if(softwareOpen)
    				software.OpenToggle("softwareOpen",0,2,300,sampleItemHeight,2,softwareHeight,500).OpenHopin;
    			if(codesamplesOpen)
    				codesamples.OpenToggle("codesamplesOpen",1,0,300,sampleItemHeight,2,codesamplesHeight,500).OpenHopin;
    			if(referencesOpen)
    				references.OpenToggle("referencesOpen",1,1,300,sampleItemHeight,2,referencesHeight,500).OpenHopin;
    			if(linksOpen)
    				links.OpenToggle("linksOpen",1,2,300,sampleItemHeight,2,linksHeight,500).OpenHopin;
    			}
    	};
    	
    			
    	// funtion to open the window
    	$.fn.OpenHopin = function(binaryBool,row,col,itemWidth,itemHeight,numRows,openHeight,speed,fn) 
    	{
    		return $(this).animate({
    			'top': (sampleItemHeight*numRows)+'px',
    		}, speed || 400, function() {
    			$.isFunction(fn) && fn.call(this);
    		}).animate({
    			'left': '0px',
    			'width': '900px',
    		}, speed || 400, function() {
    			$.isFunction(fn) && fn.call(this);
    		}).animate({
    			'height': openHeight+'px',
    		}, speed || 400, function() {
    			$.isFunction(fn) && fn.call(this);
    		});
    	}

  • #2
    New Coder
    Join Date
    Dec 2009
    Posts
    77
    Thanks
    2
    Thanked 0 Times in 0 Posts
    anyone?

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    How about
    Code:
    experience.OpenToggle(…etc…).OpenHopin();
    ?

  • #4
    New Coder
    Join Date
    Dec 2009
    Posts
    77
    Thanks
    2
    Thanked 0 Times in 0 Posts
    i have made that correction in the code on the site but it still does not work, please take a look at it
    the error is still denoted by // error here

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    Does the error console say anything? If I look at your site I get:
    Error: ReferenceError: itemLeft is not defined
    Source: http://patrickallard.net63.net/
    Line: 1381
    but I see you don’t have the function appended on that page so I don’t see what’s coming up with that function.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •