Jump to content


javascript rollovers in php

  • Please log in to reply
2 replies to this topic

#1 pomme

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 April 2006 - 06:05 PM

Hi all,

I am a bit of a php newbie but really would appreciate some help - please!

I am making a site using Dreamweaver. I have set up my php includes and wanted the menu includes to have image rollovers made with javascript. Dreamweaver spat out the javascript but it doesn't work really.

I thought ahead and figured I'd have to put the javascript in a separate file and reference it, so I cut and pasted the DW generated script in there - only works on 4 out of 8 rollovers. Honestly I don't know javascript, only use what DW makes.

Do I have the basic idea right? Can anyone help please? I will email a link to the site to anyone who's interested.

Thanks so much!

#2 wildteen88

  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 06 April 2006 - 06:21 PM

Put all your javascript into a sperate rollover.js file then use this code:
<script type="text/javascript" src="rollover.js"></script> and place that between the two <head> and </head> tags.

#3 pomme

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 April 2006 - 06:30 PM

Hey thanks for replying - I already had <script language="JavaScript" src="rollover.js"> and that didn't work - same for yours. Only 4 out of 7 rollovers work... :(

It would be the same script if I used it for any image rollover, right? And the code above would go in the include, or anywhere the rollover's supposed to be? I have 3 rollovers on the home page that aren't in an include.

So confused... *sigh*

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users