Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-21-2009, 05:02 PM   PM User | #1
JimmyFingers
New to the CF scene

 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
JimmyFingers is an unknown quantity at this point
jquery function help

I am new to jquery and this is the first project I have used it on. I am using it to load content from an external file and into my page. When you click one of the buttons it has to do 3 things. Load the main content, the description and then hide a menu. It all works but I have a huge block of code and I know that it can be compressed by passing different variables to a function. I have not been able to figure out how to do this. Here is an example of the click and links to the page and the js file.

$('#nav_port li .web .base').click(
function(){
showLoading();
content.load("sections.html #section_html", hideLoading);
desc.load("descriptions.html #brand_x_desc");
content.css({opacity: "0"});
content.fadeTo(1000, 1);
$(this).animate({opacity: "hide"}, "slow");
$(this).next().animate({opacity: "show"}, "slow");
$('#nav_port li .flash .hover').css({display: "none"});
$('#nav_port li .flash .base').css({display: "block"});
$('#nav_port li .fun .hover').css({display: "none"});
$('#nav_port li .fun .base').css({display: "block"});
$('#html_menu').css({display:"block"});
$('#flash_menu').css({display:"none"});
$('#fun_menu').css({display:"none"});
//code for span
},
function(){
//nothing
}
);


Any and all help would be greatly appreciated. Links to examples, advice, anything would be great. Thanks in advance.
http://jamesvec.com/james_dev/portfolio.html
http://jamesvec.com/james_dev/js/port_effects.js
JimmyFingers is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:33 AM.


Advertisement
Log in to turn off these ads.