View Single Post
  #4  
Old 11-13-2013, 08:46 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Category menu expand OnClick..possible ?

That is going to depend on your skin. You are using ideal_comfort so I would make all the changes in that skin directory. You should be a able to copy the code below, and simply paste it into a new template file that you create.

In this case I created: /ideal_responsive/customer/categories.tpl

You would likely create: /ideal_comfort/customer/categories.tpl

I took some time and tested this out, for now you can see it working at my test site: http://trainingpen.com/

I've modified the script to show and hide the div, clicking the link will expand and collapse. I also commented out the unnecessary part that hid other divs.

Code:
{* df14bc9e9dec4a3332552facb2c31eaaf22d39a2, v5 (xcart_4_4_2), 2010-12-17 15:12:37, categories.tpl, aim vim: set ts=2 sw=2 sts=2 et: *} <script type="text/javascript"> {literal} $(document).ready(function() { $('a.title').click(function() { var correspondingDiv = $(this).parent().next('div'); if (!correspondingDiv.is(':hidden')) { correspondingDiv.hide(150); return; } // hide other divs //$('.workdiv').hide(150); // show this one correspondingDiv.toggle(150); }); }); {/literal} </script> <div> <a href="#" id="1" class="title" name="1"><h2>Expand Categories</h2></a> </div> <div id="workdiv1" class="workdiv" style="display:none"> {if $categories_menu_list ne '' or $fancy_use_cache} {capture name=menu} {if $active_modules.Flyout_Menus} {include file="modules/Flyout_Menus/categories.tpl"} {assign var="additional_class" value="menu-fancy-categories-list"} {else} <ul> {foreach from=$categories_menu_list item=c name=categories} <li{interline name=categories}><a href="home.php?cat={$c.categoryid}" title="{$c.category|escape}">{$c.category|amp}</a></li> {/foreach} </ul> {assign var="additional_class" value="menu-categories-list"} {/if} {/capture} {include file="customer/menu_dialog.tpl" title=$lng.lbl_categories content=$smarty.capture.menu} {/if} </div>

If you feel I have earned it, you can thank me with a PayPal payment to mike@babymonkeystudios.com
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote