I wonder if you deserve any help after the aggressive behaviour against me. But i easy forget such a things. Why you close your <ol> with </ul> ? And haha what silly statement if(a.style.display=="none") { a.style.display = "block"; } if(a.style.display == "block") { a...
What about when a.style.display == null, which it will by default? .... null isn't default for OL and UL but "block". Also it isn't left to default since i set it already... :? I tried ur version but didn't work. Any other ideas? Also on a further note and on a completely different questi...
That's... not a solution. Why do you think we needed to create a function? That will only work in Mozilla. IE won't work. I think Safari won't work. I also think Opera won't either (though unconfirmed). For the first time i can say this phrase: you're wrong! :lol: It works in both IE and Opera I ma...
Never mind... Nailed it :D Here's the solution i came up with ... function GetPosition(obj) { var y, tmp; y = document.getElementById('div2').offsetTop; return {'y' : y}; } I haven't tried using the "obj" object that i enter into the function but i'm fine with it if it works :lol:
You are using the function completely incorrectly. I gave you the parameters in the comment. The obj parameter does not take a String, it takes an Object. Think about it. Heh i was trying to get it not as a string but as an array :D And becouse im relatively new to JS i'm looking at w3schools js re...
The function returns an object with the x and y position, but you can simplify it to just return an integer of the y position. So i can get the y value with GetPosition('div2')['y'] ?? It depends on the browser. Some browsers do it for each pixel (I think IE does), and others only do it after the r...
Thanks a lot for your answer... MSDN? You went to the producers of the browser with the worse possible DOM in existence for JavaScript documentation? ... You're one crazy kid. :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: It was the one with the best possible definition for it (at least for ...
Ok i looked into it, but what i don't get is exactly how they're supposed to work...
As i've seen i can't use offsetTop directly and i need to state which is the parent with offsetParent
How exactly do i do that?... MSDN had some complicated examples
I'm trying to make one of divs i got, change height based on the top of another div that has bottom: 0px; attribute set if the user resizes the page. I tried something like: var height = document.getElementById('div2').style.top function changeheight(){ var difference = document.getElementById('div2...
And i didn't start the hostilities... he started every post with WTF or WTH... how could i respond to that? :roll: I think that he's just having one of those days... It's understandable. I'm nicer some days than others. Today's a nice day. ;) I suppose :wink: I knew it immediately i seen your HTML....
Put the handbags down ladies http://pa.ranoid.co.uk/play/smilies/boxing.gif :lol: :lol: How the hell i can know it without to see your HTML code which you so furious hide from me ? Well you said that you knew immediately what my issue was ^_^ Javascript is completely dependent on the HTML that it a...
1) I never said If() was correct...read up. I already knew that but i'm used to case-insensitivity in php
2) If you had known from the beggining why let me go through all of this and not suggest it?
3) Yeah it solved it ....thanks