/    Sign up×
Community /Pin to ProfileBookmark

Pinpointed the Problem: working in IE and Safari, but not in Firefox

I’m trying to create an image gallery using CSS, dHTML and javaScript for a design portfolio at [url]www.apartmentkdesign.com[/url]

the way i want to go about cycling through the images is to actually change the source of the image dynamically using ONE modular function that’s called whenever the “next” or “previous” button is clicked below an image.

it works in Internet Explorer (albeit without fade-in effects) and in Safari perfectly (or perfectly enough), but gets caught up in Firefox, Netscape, Mozilla, and I imagine in other untested Gecko-based browsers.

I’ve pinpointed the problem to this conditional statement:
does anyone know of any compatibility problems?

[CODE]
if((all_imgs[i].className == “full”) && (all_imgs[i].parentElement.style.visibility == “visible”)){
img_id = all_imgs[i].id;
}
[/CODE]

it’s within function “tempCycle” located at [url]www.apartmentkdesign.com/javascript/design.js[/url]

any help would be greatly appreciated!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Orc_ScorcherJul 21.2005 — Replace parentElement with parentNode. And check Firefox' JavaScript console if you encounter more problems.
Copy linkTweet thisAlerts:
@alexiconauthorJul 22.2005 — you are the man!

i cross-posted that in like 5 forums, and you were the first and only to respond thus far, and that totally fixed it for all the Gecko browsers. my site now works thanks to you.

i owe you one.

thanks again,

alex
×

Success!

Help @alexicon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...