treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Disable parent pages

  • Hi,

    I have a drop down menu in which only a few are needed for drop downs.. the others are just a single option such as sponsorship

    www.leehughes.co.uk

    But for the menu with the drop down options the user can click the parent page but there is nothing on that page as I don't need that page..

    For example my mutimedia page is empty as well as any other menu with a drop down..

    Is there a way I can disable these pages? I remember using # on dreamweaver, this seemed to do the job but now am on wordpress..

    any thoughts?

    Thanks
  • on jQuery way:

    $('#nav li:has(ul)').children('a').click(function(){ return false; });

    It just disable link, didn't remove anything.
  • Ohh wow thanks..

    Where do I put this then? header or body?

    Many thanks :)
  • I suggest in head section:

    <script type='text/javascript'>
    $(function(){
    $('#nav li:has(ul)').children('a').click(function(){ return false; });
    });
    </script>

    and of course you should import jQuery.
  • Thanks..

    What do you mean import jQuery?

    I have the script, do I just attach it to a stylesheet or something ?

    Thanks again :)
  • <script type=\"text/javascript\" src=\"jquery.js\"></script>

    or if you don't have jquery.js:
    <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
  • many thanks..

    I have added both pieces of code to my header now but the problem is still there with the parent pages..