CrAzEd Posted August 22, 2006 Share Posted August 22, 2006 http://rpahosting.com/ryan/am_l/index.php?v=http://rpahosting.com/ryan/am_l/index.php?v=Why arn't my javascript rollovers working.Link for css and js - http://rpahosting.com/ryan/am_l/scripts/js.jshttp://rpahosting.com/ryan/am_l/scripts/style.cssPlease help me. Link to comment Share on other sites More sharing options...
CrAzEd Posted August 22, 2006 Author Share Posted August 22, 2006 *post to keep at top* Link to comment Share on other sites More sharing options...
ThePsion5 Posted August 22, 2006 Share Posted August 22, 2006 Perhaps you should look into a javascript debugger, or post an example of what you want it to do and your code? Just telling us to go to the page and figure it out for you suggests you aren't willing to do any actual work. Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 23, 2006 Share Posted August 23, 2006 When you're defining the new images with new Image(), what is with the arguments? You don't need 100,45 from what I know...in fact, I didn't even know the new Image function had arguments! Link to comment Share on other sites More sharing options...
CrAzEd Posted August 24, 2006 Author Share Posted August 24, 2006 The linking is just the easiest way to get help. That is my site, the one i want fixed. And supposedly the100,45 are width-height. I dont know if they are needed or not. Link to comment Share on other sites More sharing options...
CrAzEd Posted August 24, 2006 Author Share Posted August 24, 2006 Perhaps there is a problem with javascript and php? it worked perfectly before i added the php, and the code hasnt changed. Im using a system for the main text section, using [code]<?php if ($_GET['v'] == '') { $page = "phpbody/home.php"; } elseif ($_GET['v'] == '1') { $page = "phpbody/contact.php"; } elseif ($_GET['v'] == '2') { $page = "phpbody/limousines.php"; } elseif ($_GET['v'] == '3') { $page = "phpbody/about.php"; } elseif ($_GET['v'] == '4') { $page = "phpbody/sthummer.php"; } elseif ($_GET['v'] == '5') { $page = "phpbody/suv.php"; } elseif ($_GET['v'] == '6') { $page = "phpbody/bmw.php"; } elseif ($_GET['v'] == '7') { $page = "phpbody/hummerh2.php"; } elseif ($_GET['v'] == '8') { $page = "phpbody/gallery.php"; } ?> in the head, and this <?php include ("$page"); ?> to add the page. I hope you understand what i mean. Here is an example of the javascript. - if (document.images) { pic1on= new Image(); pic1on.src="images/limousines_over.gif"; pic1off= new Image(); pic1off.src="images/limousines_up.gif"; } Those link to the images, and this is the load/unload - function lightup(imgName) { if (document.images) { imgOn=eval(imgName + "on.src"); document[imgName].src= imgOn; } }function turnoff(imgName) { if (document.images); { imgOff=eval(imgName + "off.src"); document[imgName].src= imgOff; } } As i said before, this worked perfectly before i added the php above. Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 24, 2006 Share Posted August 24, 2006 Well, first of all, have you tried using the "switch" statement in php? It's a bit more orderly than using a couple of ifs/elseifs. Here's your code in switch: switch($_GET['v']) { case '' { $page = "phpbody/home.php"; } case '1' { $page = "phpbody/contact.php"; } case '2' { $page = "phpbody/limousines.php"; } case '3' { $page = "phpbody/about.php"; } case '4' { $page = "phpbody/sthummer.php"; } case '5' { $page = "phpbody/suv.php"; } case '6' { $page = "phpbody/bmw.php"; } case '7' { $page = "phpbody/hummerh2.php"; } case '8' { $page = "phpbody/gallery.php"; } } See if that works? Link to comment Share on other sites More sharing options...
CrAzEd Posted August 25, 2006 Author Share Posted August 25, 2006 Nope i got Parse error: syntax error, unexpected '{' in /home/rpahost/public_html/ryan/am_l/index.php on line 15 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now