php list and mouse events

Posted on 2009-02-23
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.


    <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>


if ($video == 'yes') {

echo'<li><a href="#"onclick="MM_showHideLayers('vid','','show')">vid</a></li>';




Open in new window

Question by:Neil_Bradley
    LVL 6

    Expert Comment

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

    Accepted Solution

    ... or write

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

    Open in new window


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now