简体   繁体   中英

Magic-line nav causing some troubles #works only on hrefs included in menu

Im using multiple (2) jquery versions on a site, i thought that it was a problem, but it doesnt seem so. I found out that i actually got a problem with magic-line navigation http://css-tricks.com/jquery-magicline-navigation/ .

What happens is that it works only on sites that are included in the menu itself. Lets say im on projects site(that is included in the menu itself), everything works ok, but when i open a view of a certain project, the "underline" effect stops working, this is how it looks:

不起作用的魔术线

i didnt sleep for 4 days, im late for deadline , my brain hurts, plx help

EDIT: i dont think its my code but if it was here it is

some additional info about the code:

base.html

                <ul class="group" id="example-one">
                {% for i in mains %}
                <li class="{% block activetab %}{% endblock %}"><a href="{{ i.menulink }}">{{ i.name }}</a></li>
                {% endfor %}
                </ul>

whats included in certain views:

    {% block activetab %}
    {% ifequal request.get_full_path|cut:"/" i.menulink|cut:"/" %}current_page_item{% endifequal %}
    {% endblock %}

It seems that menu buggs if there is no single li with current_page_item class, i hacked it by forcing:

{% ifequal ourprojects i.menulink|cut:"/" %}current_page_item{% endifequal %}

on single project view. ALthough it works now, it wont if someone changes the path to ourprojects in the admin panel. I would still like to find a proper solution that would work even if someone changes the path... #or i could just disallow changing the path... but thats another sucky solution.

and so it stayed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM