need help with a glitch on a site i'm preparing

Discussion in 'Web Design and Development' started by sk3pt1c, Jan 21, 2011.

  1. sk3pt1c macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #1
    hi there, so i'm building this site for a lady that sells furs and stuff, i uploaded what i have so far here
    the glitch i'm having is with the gallery (not exactly though)
    if you click on the gallery you're taken to it and it works just fine.
    but
    if you click back on "home" or "profile" and then back to the gallery, it doesn't appear anywhere and you have to refresh the page for it to work...
    which is what's bugging me
    thoughts?

    thanks in advance for your time, kind peoples of macrumors :)
     
  2. edm macrumors newbie

    Joined:
    Dec 27, 2006
    Location:
    Austin, TX
    #2
    Everything is there. I suspect it's a timing issue as the second time you go to the page, it's probably in cache. You might want to use the jQuery.ready() function to initialize your jQuery "stuff". http://api.jquery.com/ready/
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    I see the problem as well with Firefox (Windows). I believe it's within this portion of jQuery code from the HTML page:
    PHP:
    jQuery("#menuContent").find("div:visible").fadeOut("fast", function(){
                            
    jQuery(this).parent().find("#"+idToLoad[0]).fadeIn();
                        })
    The .find("div:visible").fadeOut(...) portion gets applied to all div tags within #menuContent, so all are faded out (display:none). On the inside though, when you apply the fadeIn, it's only being applied to the item of idToLoad[0] (#pics I believe), but the divs within it are still faded out. Firebug won't really let me edit the JavaScript to try anything further, but that's what it looks to me.
     
  4. sk3pt1c, Jan 21, 2011
    Last edited by a moderator: Jan 22, 2011

    sk3pt1c thread starter macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #4
    excuse the delay, time zone limitations :)

    i just tried that and it's not what is at fault, it still doesn't show it the second time round... :(

    thanks though! :)

    i think i get what you're saying but it should fade all divs in as it faded them out, no?
    if it fades #pics in, shouldn't it fade all the divs inside it in as well?
    if not, how would i got about fading them in?
    if i add a specific line to fade in the slideshow, won't it fade in every time?
    it is all on one page, after all... :confused:

    EDIT: here's a zip with the files if you feel up to tinker with them :) thanks a bunch! :)
     
  5. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    I found at least one solution.
    PHP:
    //                    jQuery("#menuContent").find("div:visible").fadeOut("fast", function(){
    //                         jQuery(this).parent().find("#"+idToLoad[0]).fadeIn();
    //                     })
                        
    jQuery("#menuContent").parent().find("#menuContent>div:visible").fadeOut("fast", function(){
                            
    jQuery(this).parent().find("#"+idToLoad[0]).fadeIn();
                        })
    The commented out part shows what was there, and then my proposed way. The difference is what's selected to fade out. I used the CSS selector > part to say only div that are direct children of #menuContent get faded out, and not all div inside it.
     
  6. sk3pt1c thread starter macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #6
    awesome, thanks for helping me out yet again :)

    i just love asking questions here and having nice people help me and explain stuff so i can learn more in the process

    thank you, kind sir :)
     

Share This Page