Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Fading Menu Question Re: jQuery Fading Menu Question

#62704
MTM777
Member

Point taken. Here is the javascript:

Code:
$(“#page-wrap div.button”).click(function(){

$clicked = $(this);

// if the button is not already “transformed” AND is not animated
if ($clicked.css(“opacity”) != “1” && $clicked.is(“:not(animated)”)) {

$clicked.animate({
opacity: 1,
borderWidth: 5
}, 600 );

// each button div MUST have a “xx-button” and the target div must have an id “xx”
var idToLoad = $clicked.attr(“id”).split(‘-‘);

//we search trough the content for the visible div and we fade it out
$(“#content”).find(“div:visible”).fadeOut(“fast”, function(){
//once the fade out is completed, we start to fade in the right div
$(this).parent().find(“#”+idToLoad[0]).fadeIn();
})
}

//we reset the other buttons to default style
$clicked.siblings(“.button”).animate({
opacity: 0.5,
borderWidth: 1
}, 600 );

});

Here is the body:

Code:

home
about
contact

This content is for home.

This content is for about.

This content is for contact.

When I add a div to any content area, About for example, what is inside the div does not show up.
Example:

Code:

This content is for about.

This does not appear

Any help would be appreciated.