javascript in wordpress
-
Hi, I’m playing around with a rollover image javascript. I get it to work in the masthead by putting part of the code, as per the javascript creator’s instructions, in the “head” section (in part of “header.php”) and the rest in the “body” section (also in “header.php”). However, when I try to add the “body” part of the code to another part of the body (say in the footer), it prevents the javascript from working in both the footer and in the masthead, although one of the rollover images does appear. Please help if you can.
The code is as follows for the head
<script language="Javascript"> <!-- //Slide Show script (this notice must stay intact) //For this and more scripts //visit java-scripts.net or http://wsabstract.com if (document.images) { button1 = new Image button2 = new Image button1.src = 'img1.jpg' button2.src = 'img2.jpg' } //--> </script> In the body of the "header.php" i put the following and also added it to the "footer.php" to make it work there as well (which stopped the whole thing from working)<div id=”imager”><img src=”img1.jpg” border=0 name=”rollover”></div>’
`
The topic ‘javascript in wordpress’ is closed to new replies.