IE does understand getElementByID.Fubonis wrote: If I remember correctly, Microsoft Internet Explorer does not support getElementById. I think MSIE uses document.all(string).
DHTML Woes...
Forum rules
Please do not post any "phpBB" specific topics here unless they do not fit into the category above.
Do not post bug reports, feature or support requests! No really... Do not post bug reports, feature or support requests! Doing so will make Bertie a very sad bear indeed. :(
Please do not post any "phpBB" specific topics here unless they do not fit into the category above.
Do not post bug reports, feature or support requests! No really... Do not post bug reports, feature or support requests! Doing so will make Bertie a very sad bear indeed. :(
- dhn
- Registered User
- Posts: 1518
- Joined: Wed Jul 04, 2001 8:10 am
- Location: Around the corner
- Contact:
Re: DHTML Woes...
Re: DHTML Woes...
I hope it includes the phpBB copyright by the time it's finished.FF8Jake wrote: My upcoming template for 2.0.*, Schlick
-
- Registered User
- Posts: 31
- Joined: Wed Jun 11, 2003 2:43 pm
- Location: An arrangement of pixels on your screen.
- Contact:
Re: DHTML Woes...
It will. I've not decided what I want to do to the footer yet, but it will most likely be graphical like the rest of the template.Pit wrote: FF8Jake wrote:My upcoming template for 2.0.*, Schlick
I hope it includes the phpBB copyright by the time it's finished.
After some research i've found it's IE not doing getAttribute() correctly. I setup a few alerts to echo what values getAttribute() returned, and they were correct in firefox, but "[object]" in IE.dhn wrote: Fubonis wrote:If I remember correctly, Microsoft Internet Explorer does not support getElementById. I think MSIE uses document.all(string).
IE does understand getElementByID.
Still researching...
- dhn
- Registered User
- Posts: 1518
- Joined: Wed Jul 04, 2001 8:10 am
- Location: Around the corner
- Contact:
Re: DHTML Woes...
That was what I assumed. A solution I am using most of the time would be:After some research i've found it's IE not doing getAttribute() correctly. I setup a few alerts to echo what values getAttribute() returned, and they were correct in firefox, but "[object]
" in IE.
Code: Select all
document.getElementById(id).style.display = "block";
Code: Select all
document.getElementById(id).style.display = "hidden";
Code: Select all
#example {
display: block;
}
I suggest a function like:
Code: Select all
function toggle (id, initalState) {
if (initialState == "closed" && document.getElementById(id).style.display == "") {
//first case, in which the style.display of you element is empty
}
}
Re: DHTML Woes...
If you want a menu, check out my menu software (look at my sig). It supports context menus like you want and works across most browsers (Mozilla, Opera, IE 5.5+, etc).
Josh
Josh
-
- Registered User
- Posts: 397
- Joined: Tue Jul 20, 2004 6:21 am
- Location: Rotterdam, The Netherlands
- Contact:
Re: DHTML Woes...
thats a nice template you made
just a question, will you update ( when it works ) it for phpBB Olympus?
P.S. wasnt Koholint Island from the GB game? just cant get at the name at the moment.. ( was stolen from me a long time ago so i kinda forgot )
just a question, will you update ( when it works ) it for phpBB Olympus?
P.S. wasnt Koholint Island from the GB game? just cant get at the name at the moment.. ( was stolen from me a long time ago so i kinda forgot )
-
- Registered User
- Posts: 31
- Joined: Wed Jun 11, 2003 2:43 pm
- Location: An arrangement of pixels on your screen.
- Contact:
Re: DHTML Woes...
All will be revealed. I really wasn't wanting anyone to know about the template until it was ready to go. Let's just say I have great plans for it.Uchiha Nick wrote: thats a nice template you made
just a question, will you update ( when it works ) it for phpBB Olympus?
P.S. wasnt Koholint Island from the GB game? just cant get at the name at the moment.. ( was stolen from me a long time ago so i kinda forgot )
As for further info about the template, i'd be glad to take PMs about it, instead of derailing this topic on the javascript problem.
dhn: I hadn't thought about an initial state type setup. I'll give it a shot when I get home from work. Cheers.
-
- Registered User
- Posts: 31
- Joined: Wed Jun 11, 2003 2:43 pm
- Location: An arrangement of pixels on your screen.
- Contact:
Re: DHTML Woes...
Finally solved the problem. IE very much screwed up the standards again. getAttribute and setAttribute support is very shoddy, though they claim it to be "supported". So, the solution? I knew from an earlier version of the menu(which didn't use a toggle, it used a seperate link to close the menu) that this code worked well in Firefox and IE:After trying to get a toggle to work, I stumbled upon setAttribute, and decided i'd code my function to be able to change whatever I wanted, not just the style. This worked awesome in firefox, but IE hates setAttribute and doesn't use it properly. So, scratch that idea. Eventually I resolved to eval()(which I had found through more googling) in a function to create a dynamic version of the first code I had used, one that let me decide which style I wanted to change through the array values. For the sake of simplicity, I made a toggler for images seperately. I also started storing an on/off value inside the array, instead of using getAttribute(which IE hates) to check the object's current status(kudos to dhn).
It works perfect in Mozilla and IE now. Thanks everyone, work goes on now, though if anyone wants to have another gander at the updated javascript and offer a suggestion I wouldn't mind.
Code: Select all
document.getElementById('foobar').style.display = 'block';
It works perfect in Mozilla and IE now. Thanks everyone, work goes on now, though if anyone wants to have another gander at the updated javascript and offer a suggestion I wouldn't mind.
-
- Registered User
- Posts: 448
- Joined: Mon Jul 21, 2003 7:18 pm
- Contact:
Re: DHTML Woes...
It's fixed in Safari as well.
Re: DHTML Woes...
i hope this will be open for download to the public. I love the viewtopic.