PDA

View Full Version : Javascript



Breen
July 26th, 2005, 08:54 AM
<script>
function adjustWH(value){
Height = window.innerHeight || document.body.offsetHeight
target = value/Height * 100
if (target < 100) {
target = 100
}
document.getElementById("main").height = (Math.floor(target))+"%"
}
</script>

I need to get the previous script to work in firefox (its allready working in IE) is there anything i should pay attention to?

λ
July 26th, 2005, 09:09 AM
I'm not positive about this, but try using .style.height instead of .height ;)

Breen
July 26th, 2005, 09:33 AM
Thanks for the help, but that didn't do anything, i traced my Height variable and that seemed ok, its just that i can't adjust the height of the object, as you propably allready have figured out :)

Breen
July 26th, 2005, 09:43 AM
i would like to make my intentions about the script clear, im setting the height of a flash movie, because the content in that flash movie can get bigger,
i want the script to make sure there is a scroller so that the entire page can be viewed, this worked for internet explorer by setting size to, let's say 200%, but this doens't work for firefox

Breen
July 26th, 2005, 03:23 PM
Hey you guys, solved my problem by putting a <div> around my flash object and adjusting my javascript to also give that div the proper height, now it works beautifully, thx a million