pabloliracecilio Posted July 17, 2014 Share Posted July 17, 2014 Hi fellow programmers, I installed(mySiteLink) a template from TemplateMonster(link) Everything is working fine despite my blocktopmenu on mobile. My prestashop is V 1.6.0.6 Wen I click the "+" icon on categories, it does not expand the submenu itens. The original template works fine. Some things that I struggling to figure out in presta code so I can solve this problem, and any answers would be appreciated: 1. Which is function is triggered when I press the "+" button on blockTopMenu?That function is not changing the "display" attribute of the submenu items to "block" 2. Can I enable de default theme only for mobile? The default theme works fine as well. Thanks in advance. 1 Link to comment Share on other sites More sharing options...
pabloliracecilio Posted July 17, 2014 Author Share Posted July 17, 2014 Got it working, I changed file themes/torrevermelha/js/modules/blocktopmenu/js/blocktopmenu.js function responsiveMenu() { if ($(window).width() <= 767 && responsiveflagMenu == false) { menuChange('enable'); responsiveflagMenu = true; } else if ($(window).width() >= 768) { menuChange('disable'); responsiveflagMenu = false; } } It was document before.. chaged it to window and got it working $(document).width() was return a value much bigger.. 4 Link to comment Share on other sites More sharing options...
josecarre Posted December 1, 2014 Share Posted December 1, 2014 Pal, gotta give you a big thanks, saved me a headache. On index page I used some elements extended to 1000% and this caused the menu to cease working, and you gave me the solution, wich is great because I cannot figure out anything javascript. Link to comment Share on other sites More sharing options...
Aioras Posted April 21, 2015 Share Posted April 21, 2015 Thanks Pablo, save my day! Link to comment Share on other sites More sharing options...
skool_d Posted April 29, 2015 Share Posted April 29, 2015 Thanks a lot Pablo!! You are my hero today In 1.6.14 version of Prestashop still have the same problem. Link to comment Share on other sites More sharing options...
intelsys Posted September 6, 2015 Share Posted September 6, 2015 Hi to All! I have presatshop 1.6.0.14 and no solution worked for me. My problem was at /themes/default-bootstrap/js/modules/blocktopmenu/js/blocktopmenu.js from line 26 to 37. There was a ".sf-contener" class selector that does not exist in the template code. I removed "sf-contener" and everything worked for me. var responsiveflagMenu = false; var categoryMenu = $('ul.sf-menu'); //var mCategoryGrover = $('.sf-contener .cat-title'); var mCategoryGrover = $('.cat-title'); $(document).ready(function(){ categoryMenu = $('ul.sf-menu'); //mCategoryGrover = $('.sf-contener .cat-title'); mCategoryGrover = $('.cat-title'); responsiveMenu(); $(window).resize(responsiveMenu); }); Hope helps to others. Regards! Link to comment Share on other sites More sharing options...
Rom Soul Posted January 20, 2017 Share Posted January 20, 2017 Thanks pabloliracecilio ! I just spent a few hours debugging why blocktopmenu was messing on some pages but not all ... You gave me the solution ! My beloved client copy pasted in a RTE field some html code including good old <table ... width="1000"> so the condition $(document).width() <= 767 was never ok on that precise page, so desktopInit() was called whatever the device, mobileInit() was never called, so the click on "categories" could not trigger the expected expected slideToggle() effect... Using the condition if ($(window).width() <= 767 ... instead of if ($(document).width() <= 767 ... solves this bug. Link to comment Share on other sites More sharing options...
Dmytro Korolkov Posted February 12, 2018 Share Posted February 12, 2018 (edited) On 17.07.2014 at 11:29 PM, pabloliracecilio said: Got it working, I changed file themes/torrevermelha/js/modules/blocktopmenu/js/blocktopmenu.js function responsiveMenu() { if ($(window).width() <= 767 && responsiveflagMenu == false) { menuChange('enable'); responsiveflagMenu = true; } else if ($(window).width() >= 768) { menuChange('disable'); responsiveflagMenu = false; } } It was document before.. chaged it to window and got it working $(document).width() was return a value much bigger.. Thanks a lot man!!! Edited February 12, 2018 by Dmytro Korolkov (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now