Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • olivergranlund Friend
    #200045

    Hey

    I’m building a one-page layout style webpage. One issue is the menu button when toggled, it’s still active even tho the collapsed menu isn’t active anymore. Also when selecting one anchor from the collapse menu, the menu stays open. The content gets scrolled to anchor but menu stays open all the time and you have to press separately to close it. Some automation here would be nice. I understand it’s not needed in the Purity III Demo since it links everytime to a new page.

    EDIT:

    The dropdown menu has <a> tags with anchors. I need to inject this code into everyone of them “data-toggle=”collapse” data-target=”.t3-navbar-collapse”” Any idea how to do that?

    Ninja Lead Moderator
    #543767

    Please provide your site url, so that i can have a look and tr to help you out.

    Regards

    olivergranlund Friend
    #543788

    The site I’m working on is on private network and can’t be shared, but we can think about the issue with the demo page: http://www.joomlart.com/demo/#purity_iii

    The menu items are “External URL” and contain a anchor tag, which makes the page scroll down to the info you picked. The dropdown menu still stays open and is quite annoying. I tried injecting some jquery to change it

    $(“ul.navbar-nav”).find(“a”).each(function(){
    $(this).data(“toggle”, “collapse”);
    $(this).data(“target”, “.t3-navbar-collapse”);
    });

    but didn’t work…. so I’m atm trying to find a way to change it in the source. When I debugged, I got it once working so that the dropdown menu closes when the menu item is pressed…but not anymore. I bet I need to add data-toggle=”collapse” data-target=”.t3-navbar-collapse” to some part. The demo page has many underpages and therefore doesnt need this function, but as I’m working on a 1-page website, It’s quite important that everything works out smoothly.

    Edit: I created a demo-site to explain the thing: http://f45ae83cdc85658b3069565567e9b9f5.site.joomlart.com/ So crop your browser into mobile, then open menu – Layouts – PRESS HERE

    Nothing happens since it hasnt been anchored to anything, but the menu still stays open. I need this menu to close when a “external url” has been clicked. Any ideas?

    olivergranlund Friend
    #543922

    Okay, the issue seems to be a bootstrap issue. The same issue is on bootstrap site on e.g. inverted navbar here: http://getbootstrap.com/components/#navbar

    Stretch it to mobile and try to click any of the links. I need those links to close the dropdown but I don’t know how.

    I’ll move this discussion somewhere else since it doesnt regard the template or framework of joomlart.

    edit: I was wrong, it does help on the bootstrap page if I add —data-toggle=”collapse” data-target=”.t3-navbar-collapse”— to the <a> tags, but not on Purity III template. Darn…

    Ninja Lead Moderator
    #544001

    I think I can help on this case, about the menu in Purity template, have a look at plugins/system/t3/includes/menu/megamenu.tpl.php file.

    olivergranlund Friend
    #544057

    Oh I thought it would be somewhere else than in the Mega Menu, since I have it disabled. Some testing showed that removing the class “in” would collapse the dropdown back up to normal position, but my jquery script never was able to execute that. Also just adding the data-toggle=”collapse” data-target=”.t3-navbar-collapse” doesn’t seem to be enough, as it should be a button to work… Any suggestions how to proceed?

    Ninja Lead Moderator
    #544101

    I spent a lot of time to check your request and Purity template can not support your expectations and in some special templates we have to customize it heavily like as JA Onepage template: http://ja-onepage.demo.joomlart.com/ and JA Smashboard: http://ja-smashboard.demo.joomlart.com/

    If you are a developer you can review files in in plugins/system/t3/ folder and there are somes php, js, css files to work with the menu

    pluginssystemt3basejsscript.js
    pluginssystemt3basejsmenu.js

    pluginssystemt3basecssmegamenu.css

    plugins/system/t3/includes/menu/megamenu.php
    plugins/system/t3/includes/menu/megamenu.tpl.php
    plugins/system/t3/includes/menu/t3bootstrap.php
    plugins/system/t3/includes/menu/t3bootstrap.tpl.php

    olivergranlund Friend
    #544125

    Had a big trouble getting the jQuery document ready to work, but now it does! 😀

    So I added this piece of code in there:

    jQuery(‘.navbar-nav li a’).click(function(event) {
    jQuery(‘.navbar-collapse’).removeClass(‘in’).addClass(‘collapse’);
    });

    It doesn’t have any animation, but I think it’s a side-issue, as the page is quite long and m smooth scroll animation makes the page quite jumping, but responsive 🙂

    Please keep this code in mind for other customers, as they might appreciate it 🙂

    Also thanks anyway for the help

    dominik_1 Friend
    #569923

    <em>@olivergranlund 439020 wrote:</em><blockquote>Had a big trouble getting the jQuery document ready to work, but now it does! 😀

    So I added this piece of code in there:

    jQuery(‘.navbar-nav li a’).click(function(event) {
    jQuery(‘.navbar-collapse’).removeClass(‘in’).addClass(‘collapse’);
    });

    It doesn’t have any animation, but I think it’s a side-issue, as the page is quite long and m smooth scroll animation makes the page quite jumping, but responsive 🙂

    Please keep this code in mind for other customers, as they might appreciate it 🙂

    Also thanks anyway for the help</blockquote>

    Hi,

    I have the same problem in mobile when menu’ doesn’t collapse after click an anchor link. I don’t understand. How can I fix it?

    I tried this –> https://github.com/twbs/bootstrap/issues/12852

    but I did not understand where change in joomla and purity III

    Ninja Lead Moderator
    #570085

    @dominik_1: I’m not sure about the solution from you mentioned above to solve the with mobile layout, you can upgrade T3 latest version and check with mobile layout again, if you still face the problem, I will raise that bug to development team to fix next version.

    dominik_1 Friend
    #570312

    <em>@Ninja Lead 472760 wrote:</em><blockquote>@dominik_1: I’m not sure about the solution from you mentioned above to solve the with mobile layout, you can upgrade T3 latest version and check with mobile layout again, if you still face the problem, I will raise that bug to development team to fix next version.</blockquote>

    @ninja Lead the t3 framework is updated. For me it’s a big problem because the site is a landing page with a menu to 3 anchors: in mobile, if menu doesn’t collapse after click an anchor, It becomes unusable.

    Ninja Lead Moderator
    #570313

    Can you give me the URL of your site, a screenshot and describe what are you trying to do on your site? It would help to understand the problem on your site.

    dominik_1 Friend
    #570316

    @ninja Lead It’s in local. You should have PM

    Ninja Lead Moderator
    #570381

    <em>@dominik_1 473020 wrote:</em><blockquote>@Ninja Lead It’s in local. You should have PM</blockquote>

    I tried to access URL site from your pm but I could not access it, you can put it to live site and I will help you to check it.

Viewing 14 posts - 1 through 14 (of 14 total)

This topic contains 14 replies, has 3 voices, and was last updated by  Ninja Lead 9 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum