Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to create no-link class #75

Open
selwynorren opened this issue Jun 10, 2015 · 1 comment
Open

Option to create no-link class #75

selwynorren opened this issue Jun 10, 2015 · 1 comment

Comments

@selwynorren
Copy link

Hi, Wow what a great script thanks so much. I am so sad I only discovered it today.

Using one of the pull requests I have manage to find a work around, but I don’t know enough of jQuery to completely implement what I need here.

In the menu sample I have change the parent link of Bing as follows:

<nav class="element">
    <ul id="nav">
        <li><a href="http://google.com">Google</a></li>
        <li class="selected"><a href="demo.html">Demo page</a></li>
        <li><a class="no-link">Bing</a>
            <ul>
                <li><a href="http://google.com">Google</a></li>
                <li><a href="demo.html">Demo page</a></li>
                <li><a href="http://bing.com">Bing</a></li>
                <li><a href="http://yahoo.com">Yahoo</a></li>
            </ul>
        </li>
        <li><a href="http://yahoo.com">Yahoo</a></li>
    </ul>
</nav>

On mobile, this still creates the link but redirects it to a non existing page (404 error) can this rather be changed that if it finds a class linking to something like .no-link it replaces that item as a optgroup rather?

Pull request no (#46) is about as close as I can get, but I think a stylable optgroup would be better.

@shacow
Copy link

shacow commented Mar 9, 2016

$('a.no-link').click(function (e) {
 e.preventDefault();
});

might be useful for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants