Topic awaiting preservation: Have no clue whats wrong with this code! Help! |
|
---|---|
Author | Thread |
Obsessive-Compulsive (I) Inmate From: |
posted 02-19-2005 23:20
Hey guys, I have no clue whats going on with this code. I know that there is something wrong with the Resize() function because when I comment it out, window.onload works, but when i un-comment it, window.onload does not work. Not too sure whats going on here. I tried before just to have a function that had a setTimeout with a function that had an argument in it, but for some reason after the intial case, it would mess up. I am just trying to decrease the width of a Div over a short span of time. code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
Nervous Wreck (II) Inmate From: UK |
posted 02-20-2005 13:18
code: this.o.class = 'xClose';
|
Paranoid (IV) Inmate From: France |
posted 02-20-2005 13:48
ub3r_n00b: Hello and welcome in the Asylum. code: this.o.setAttribute( 'class', 'xClose' );
code: w = parseInt(this.o.parentNode.style.height); might be replaced by code: w = parseInt(this.o.parentNode.offsetHeight);
code: var newX; outside of all function. |
Obsessive-Compulsive (I) Inmate From: |
posted 02-21-2005 04:47
Thanks! Totally hate stupid mistakes that I am oblivious to when I double check my code :P. You guys are the best. |
Bipolar (III) Inmate From: London |
posted 02-21-2005 12:10
Don't forget the second ",10" parameter when using parseInt: code: w = parseInt(this.o.parentNode.offsetHeight, 10);
|
Paranoid (IV) Inmate From: France |
posted 02-21-2005 12:58
We already mentionned that detail in another thread, but let's remind that the parseInt( ) function converts a string into a number. The resulting number is in octal if the numeral value contained in the string begins with a 0 ... which indicates a number is in octal. But there's no way to meet this situation with the very script above. |