Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

php list and mouse events

Posted on 2009-02-23
2
Medium Priority
?
1,643 Views
Last Modified: 2013-12-13
I have built a simple menu and the last list item in the menu is shown conditionally using a simple if else php clause.

The problem is that the mouse when I try to insert a mouse event in to my conditional list item it does not work and I receive an error.
Shown bellow is the code I am using.
Thanks

<ul>
    <li><a href="#" onclick="MM_showHideLayers('specs','','show')">specs</a></li>
    <li><a href="#" onclick="MM_showHideLayers('text_Insert','','show')">info</a></li>
    <li><a href="#" onclick="MM_showHideLayers('gallery','','show')">images</a></li>
    <?php
if ($video == 'yes') {
echo'<li><a href="#"onclick="MM_showHideLayers('vid','','show')">vid</a></li>';
}
?>
 
  </ul>

Open in new window

0
Comment
Question by:Neil_Bradley
2 Comments
 
LVL 6

Expert Comment

by:digital0iced0
ID: 23718308
Change this: echo'<li><a href="#"onclick="MM_showHideLayers('vid','','show')">vid</a></li>';
to:
echo'<li><a href="#"onclick="MM_showHideLayers(\'vid\',\'\',\'show\')">vid</a></li>';
0
 
LVL 20

Accepted Solution

by:
thehagman earned 1000 total points
ID: 23719384
... or write



if ($video == 'yes') {
?>
<li><a href="#" onclick="MM_showHideLayers('vid','','show')">vid</a></li>
<?
}

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question