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

Implement the plugin #16

Open
StrazzaD opened this issue Jul 15, 2013 · 1 comment
Open

Implement the plugin #16

StrazzaD opened this issue Jul 15, 2013 · 1 comment

Comments

@StrazzaD
Copy link

Hello, first I would like to thank you for this wonderful plugin.

Unfortunately I can not make it work in any way

The console shows me two errors:

Uncaught ReferenceError: selectnav is not defined index.html: 453
Uncaught ReferenceError: selectnav is not defined custom.js: 22

<ul class="nav" id="navs">
                            <li>
                                <a href="#">Home</a>
                            </li>
                            <li>
                                <a href="#">Sliders</a>
                            </li>
                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                    Pages
                                    <i class="icon-caret-down"></i>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="dropdown-submenu">
                                        <a>Example</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="">Asd</a></li>
                                            <li><a href="">Asd</a></li>
                                            <li><a href="">Asd</a></li>
                                            <li><a href="">Asd</a></li>
                                        </ul>
                                    </li>
                                    <li>
                                        <a>Example</a>
                                    </li>
                                    <li>
                                        <a>Example</a>
                                    </li>
                                </ul>
                            </li>
                            <li><a href="#">Features</a></li>
                            <li><a href="#">Shortcodes</a></li>
                            <li><a href="#">Why Me ?</a></li>
                        </ul>
        <script src="http://code.jquery.com/jquery.js"></script>
    <script type="js/selectnav.min.js"></script>
    <script>selectnav('nav');</script>
    <script src="js/custom.js"></script>

Css

/* default style */
.selectnav { display: none; }

/* small screen */
@media screen and (max-width: 600px) {
  .js #nav { display: none; }
  .js .selectnav { display: block; }
}

JS in custom.js

selectnav('nav');

I hope you can help me because I'm completely stuck with my work.

Thanks in advance

@ruudbwai
Copy link

selectnav is not being loaded. At first glance,

 script type="js/selectnav.min.js" 
should be
 script src="js/selectnav.min.js" 

as long as thats the path to selectjs on your folder.

Next apply the ID of the menu to selectnav, instead of the class, so

 selectnav('nav');
should be
 selectnav('navs');
in your case.

I think it's better to target IDs so you can have better control of where selectnav is applied.;)

Also, your css looks wrong. your menu id is #navs so

.js #nav { display: none; }
should be
.js #navs { display: none; }

Good luck!

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