Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
FireFox Javascript not working
Old 02-09-2007, 02:31 AM FireFox Javascript not working
Junior Talker

Posts: 2
Trades: 0
Hey, all

I'm having an issue with some simple js in FireFox. It works perfectly in IE and other browsers tested.

Here's the function:

<script type="text/javascript">
function setHeight() {
obj = document.getElementById("adjustedDiv");

if (obj.style.height == "30px") {
obj.style.height = 250;
}
else
{
obj.style.height = 30;
}
}
</script>

and the div looks like this:

<div id="adjustedDiv" style="height: 30px; width: 200px; overflow: auto; background-color: #0066FF" onmouseup="setHeight();"></div>

My js is rudimentary, to say the least. Whilst I've picked up other pages dealing with FireFox's strange js issues, none seem to apply here - at least, not that I'm able to tell. Any help would be greatly appreciated!
Wither is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-09-2007, 03:02 AM Re: FireFox Javascript not working
Junior Talker

Posts: 2
Trades: 0
Solved.

It seems IE generously assumed I meant pixels when I assigned the new values. obj.style.height = "250px" works perfectly in FireFox.
Wither is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to FireFox Javascript not working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12568 seconds with 12 queries