Despot Posted May 21, 2009 Share Posted May 21, 2009 Hope you guys can help.I have vertical nav buttons on my webpages, I have put them into a PHP insert so that they are easy to rearrange etc.What I am also trying to do is make the button for the page being displayed full visible, while all the others are transparent. At the same time I have some javascript working so the image changes on mouseover.To do this I have set a variable, $page for each page and the following code with each jpeg<? phpif ($page="default") style="opacity:1.0;filter:alpha(opacity=100)";else style="opacity:0.6;filter:alpha(opacity=60)";?><a href="default.php"> <img border="0" alt ="About Us" height="50" width="150" src="images/vnavbar/aboutusOff.jpg" name ="aboutus" onmouseOver ="aboutusOver()" onmouseOut ="aboutusOut()" /></a>I am getting a parse error on line 2Please let me know if you have any ideas. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 21, 2009 Share Posted May 21, 2009 When you use the identifier "style" without a $ before it, it think you're trying to set a constant, and you're not allowed to set a constant other than by using define. Add a $ to make it a variable instead.Also, you're not printing the style information into the HTML markup, so it's not going to affect anything. Link to comment Share on other sites More sharing options...
denny911 Posted May 24, 2009 Share Posted May 24, 2009 Hope you guys can help.I have vertical nav buttons on my webpages, I have put them into a PHP insert so that they are easy to rearrange etc.What I am also trying to do is make the button for the page being displayed full visible, while all the others are transparent. At the same time I have some javascript working so the image changes on mouseover.To do this I have set a variable, $page for each page and the following code with each jpeg<? phpif ($page="default") style="opacity:1.0;filter:alpha(opacity=100)";else style="opacity:0.6;filter:alpha(opacity=60)";?><a href="default.php"> <img border="0" alt ="About Us" height="50" width="150" src="images/vnavbar/aboutusOff.jpg" name ="aboutus" onmouseOver ="aboutusOver()" onmouseOut ="aboutusOut()" /></a>I am getting a parse error on line 2Please let me know if you have any ideas.try this:<?phpif($page="default") { print 'style="opacity:1.0;filter:alpha(opacity=100)" '; }else{ print 'style="opacity:0.6;filter:alpha(opacity=60)" '; }?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.