Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
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 :)
 
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.
 
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/

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! :)

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.

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! :)
 
Last edited by a moderator:
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.
 
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 :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.