User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,207 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,291 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 682 | Replies: 2 | Solved
Reply
Join Date: May 2008
Posts: 4
Reputation: rhand is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rhand rhand is offline Offline
Newbie Poster

External Javascript does not laod + error

  #1  
May 14th, 2008
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
http://www.xxx.xx/xxx/wp-content/themes/Verhoijsen2/float.js
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?
Last edited by rhand : May 14th, 2008 at 11:31 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2008
Posts: 4
Reputation: rhand is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rhand rhand is offline Offline
Newbie Poster

Re: External Javascript does not load + error

  #2  
May 15th, 2008
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 2.0.0.14. I still get the error:
document.body has no properties
http://www.domain.xx/folder/wp-content/themes/Verhoijsen2/float.js
Line 2

How come? Does anybody have an idea? I know I am getting close...
Reply With Quote  
Join Date: May 2008
Posts: 4
Reputation: rhand is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rhand rhand is offline Offline
Newbie Poster

Re: External Javascript does not load + error

  #3  
May 15th, 2008
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!!
Last edited by rhand : May 15th, 2008 at 2:52 am. Reason: forgot a remaining issue
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 2:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC