Forums

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

Home Forums JavaScript jQuery Fading Menu Question

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25786
    MTM777
    Member

    I’m a complete beginner who has been messing around with the navigation in this post:

    http://css-tricks.com/learning-jquery-fading-menu-replacing-content/

    I’m finding that I when I wrap anything in divs within each content area div, it will not show up.
    It seems like an easy fix in the js but I don’t know how to do it.

    Any help would be appreciated.

    #62431
    Mr KiTT3N
    Member

    Providing code snipplets or better yet a link to where this error is at helps out tremendously

    A link to a tutorial doesnt ….

    #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.

    #75091
    gmeben
    Participant

    I’m experiencing the same problem; none of the nested divs appear.

    There has to be some way to denote showing the nested divs in the jQuery when clicked upon.
    Help please!

    #75381
    gmeben
    Participant

    If there isn’t a fix to this, can anyone lead me to an alternative method that has at least has a vaguely similar effect?

    #76716
    gmeben
    Participant

    thankfully, chris did a screencast for this exact issue just a few days after i posted. i’m posting this for anyone reading this thread in the future who wants to know of the alternative:

    https://css-tricks.com/video-screencasts … c-content/

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.