View Single Post
Old 06-04-2019, 01:21 PM
keystone keystone is offline

Join Date: Jul 2006
Location: USA
Posts: 740

Default ideal responsive template menus

I am trying to make the speed bar and category links show up in drop down lists when the screen size is 767 px or less. I have it working on my 4.6.6 store php 5.4 but when I copy the code (and css) info over to my development 4.7.11 php7.2 site it doesn't quite work and I can't figure out why. They layout is showing up how I want, while the page is loading the first item in each of the drop downs shows up as text (so for the speed bar you can see Quick Menu and for the categories drop down, you can see Categories) but as soon as the page is finished loading, the text disappears and you can see 2 blank drop downs. If I click the drop down arrow I can see all the options just fine and when selected, they do what they are supposed to.

The default .tpl code is a little different between 4.6.0 and 4.7.11 so I'm guessing there is something there that is causing it. I did remove the javascript portion of the tabs-mobile and categories-mobile and the text remained visible when the page was finished loading but it didn't work properly when clicked. I don't know a lick of javascript so I'm not sure which part could be the issue.

I just can't figure out whey when the page finishes loading, the "default" text disappears. Here is the code from ideal_responsive/customer/tabs.tpl 4.7.11 Everything from
<div class="tabs-mobile">
is what I added
{if $speed_bar} <div class="tabs{if $all_languages_cnt gt 1} with_languages{/if} monitor"> <ul> {math equation="round(100/x,2)" x=$speed_bar|@count assign="cell_width"} {foreach from=$speed_bar item=sb name=tabs} {strip} <li{interline name=tabs foreach_iteration="`$smarty.foreach.tabs.iteration`" foreach_total="`$`" additional_class="hidden-xs"}> <a href="{$|amp}"> {$sb.title} <img src="{$ImagesDir}/spacer.gif" alt="" /> </a> <div class="t-l"></div><div class="t-r"></div> </li> <li{interline name=tabs foreach_iteration="`$smarty.foreach.tabs.iteration`" foreach_total="`$`" additional_class="visible-xs"} style="width: {$cell_width}%"> <a href="{$|amp}"> {$sb.title} <img src="{$ImagesDir}/spacer.gif" alt="" /> </a> {if $smarty.foreach.tabs.last}<div class="mobile-tab-delim first"></div><div class="t-l first"></div>{else}<div class="t-l"></div>{/if}<div class="t-r"></div><div class="mobile-tab-delim"></div> </li> {/strip} {/foreach} </ul> </div> <div class="tabs-mobile"> <select name="mobileTabs" id="mobileTabs"> <option value="">{$lng.lbl_quick_menu}</option> {foreach from=$speed_bar|@array_reverse item=sb name=tabs} {strip} <option value="{$|amp}"> {$sb.title} </option> {/strip} {/foreach} {*** On Sale :: ***} {if $active_modules.On_Sale && $active_sales} <option value="onsale.php">DEALS</option> {/if} {*** On Sale :: ***} </select> <script type="text/javascript"> $(function (){ldelim} $("#mobileTabs").val('1'); $("#mobileTabs").change(function(e) {ldelim} window.location.href = $(this).val(); {rdelim}); {rdelim}); </script> </div> {**mobile menu**} <div class="categories-mobile"> <select name="mobileCategories" id="mobileCategories"> <option value="">{$lng.lbl_categories}</option> {foreach from=$categories_menu_list item=c name=categories} {strip} <option value="home.php?cat={$c.categoryid}"> {$c.category} </option> {/strip} {/foreach} </select> <script type="text/javascript"> $(function (){ldelim} $("#mobileCategories").val('1'); $("#mobileCategories").change(function(e) {ldelim} window.location.href = $(this).val(); {rdelim}); {rdelim}); </script> </div> {**mobil Menu**} {/if}
__________________ - X-Cart Version 4.7.11 Gold Plus php7.3
running on UNIX X-Cart Gold Plus - Version 4.7.11 php7.2
cdseo pro
running on UNIX
Reply With Quote