navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Problem with ParseInt() - JavaScript

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Problem with ParseInt() - JavaScript
Page: [1]
 
wilsona5

 

Posts: 1
Joined: 2/28/2008
Status: offline

 
Problem with ParseInt() - JavaScript - 2/28/2008 14:44:05   
Hey All - I've seem to be having issues with the ParseInt function. In the function below, the styles of two different CSS DIVS (parameters 'd' and 'e') are being affected. Parameter f is a number value (which is ultimately supposed to be added to the original height value of one of the DIVS - being passed through parameter 'e').

In the function, if I manually set 'OldHeight' to a number value, such as 1700, the function will complete without errors. However, 'OldHeight' is supposed to gather and store the original value of the CSS DIV (which 'f' is then added to). I assume that the CSS style height value is stored as a string, so I've tried using the ParseInt in order to change the value to a number, so the values are added together, instead of being concatenated. When this format is used, errors are received referencing an 'Invalid Argument.' Does anybody know what I might be doing incorrectly?

Thanks a ton!

function ShowContent(d,e,f) {
var LeftName = String(e);
var AddValue = parseInt(f);
var OldHeight = parseInt(document.getElementById(LeftName).style.height);
var stringOldHeight = document.getElementById(LeftName).style.height;
document.getElementById(d).style.display = "block";
document.getElementById(LeftName).style.height = AddValue + OldHeight;
}

- Andrew
Page:   [1]

All Forums >> Web Development >> General Web Development >> Problem with ParseInt() - JavaScript
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts