WordPress.org

Ready to get started?Download WordPress

Forums

disable link for drop down (9 posts)

  1. rhythmofthecosmos
    Member
    Posted 4 years ago #

    Hi,

    I trying to figure out a way to put in # for a parent page in wordpress to stop them linking to anything. I have a drop down which works on hoover over which is what I want but currently a user can click the parent page which leads them to a blank page which I do not want.

    For example.. http://www.leehughes.co.uk/route/#

    I read that using # will cause the page not to link but how do I do this using wordpress?

    thanks..

    http://www.leehughes.co.uk

  2. sweetevil28
    Member
    Posted 4 years ago #

    Hello, I reviewed your disable link drop down post on wordpress and I see you've accomplished it. How did you do it?

  3. jho1086
    Member
    Posted 4 years ago #

    using this

    <script type="text/javascript">
    var $j = jQuery.noConflict();

    $j(document).ready(function () {

    $j("li:has(ul)").hover(function () {
    $j(this).children("a").click(function () {
    return false;
    });
    });

    });
    </script>

  4. jonnyplow
    Member
    Posted 4 years ago #

    jho1086, in addition to yours, which works great, I added the following below to only disable the second parent in the menu. thanks for yours!

    <script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(document).ready(function () {
    $j("ul li ul li:has(ul)").hover(function () {
    $j(this).children("a").click(function () {
    return false;
    });
    });
    });
    </script>
  5. jonnyplow
    Member
    Posted 4 years ago #


  6. jonniboo
    Member
    Posted 4 years ago #

    Hi,
    Might be a daft question but where exactly does this script go?

  7. jonniboo
    Member
    Posted 4 years ago #

    Ah. In the header! derr!

  8. guatemalandude
    Member
    Posted 3 years ago #

    What if you just want it in one Page?

  9. borimrr
    Member
    Posted 3 years ago #

    Thanks for this, I used it yesterday and it worked flawlessly. Make sure it's after the wp_head() call.

Topic Closed

This topic has been closed to new replies.

About this Topic