Jump to content

why does this function work in every browser except Firefox?


mwbarry

Recommended Posts

I wrote a function to place an item 400px above the bottom of the users screen. It works fine in every browser except Firefox and I have no idea why. Firebug doesn't show any errors either.js

<script type="text/javascript">	function chng() {		cont = screen.availHeight - 400 + "px";				document.getElementById("stuff").style.top = cont;	}</script>

html

<body onload="chng()">      <div id="stuff">this text is supposed to be placed 400px above the bottom of the users screen</div></body>

css

#stuff {width:100%;position: absolute;top: 50px;

Link to comment
Share on other sites

Seems to work in FF 5 just fine.What happens to yours?Do you need to refresh your cache?
In mine the item "stuff" stays at 50px from the top. In every other browser it moves down as it should.Do you know what the specific differences are in each browser in how they display items and use js? I checked FF JS preferences to make sure everything was activated. I can't think of any reason FF would fail to run this script without even returning an error in firebug while other browsers run it fine. All other scripts I have written work in FF fine.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...