I have been working on a Wordpress theme for some time now. I got a javascript from the original website. I import it into the Wordpress header.php. But it does not work at all. No floating images as I move my mouse. Nothing at all. Firebug gives me this error:

document.body has no properties
Line 2

On that line of the javascript you will find this:

var screenheight  =document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

I know very little about javascript, so I would appreciate your help. Maybe I need to change the code as I import it now instead of having it in the header =>index itself?

10 Years
Discussion Span
Last Post by rhand

Well, I have got the images to float in IE7. I forgot to put the image folder in the root. :-). But every time an image leaves the screen, the screen enlarges until it has left :-( . The images now cover everything, so I still need to work on the z-index. I will work that out later.
The scroll bar issue is more pressing. If I add body {overflow:hidden;} it might be gone, but then I cannot scroll down the page anymore.
Furthermore, I still see nothing of the floating images in Firefox I still get the error:

document.body has no properties
Line 2

How come? Does anybody have an idea? I know I am getting close...


Well, I fixed the error in Firefox. Because the javascript was loaded before the body was formed it did not work. I added the javascript include snippet:

<script type='text/javascript' src="<?php bloginfo('template_url'); ?>/float.js">

in the footer. And yes now it loads!!!!
The final issue will be to resolve the ugly vertical and horizontal scroll bars showing up when an image is about to leave the screen. And make sure the images pass behind the content. Any final tips anybody? Some help on the scrolling issue especially would be great!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.