Advertisement:

Author Topic: to Raja Sekar ,,,make category list in modern theme drop down by hover ...?  (Read 2560 times)

adminrahul

  • Newbie
  • *
  • Posts: 14
hello !

I am making a website where i want that if i put mouse on category subcategory  are open so i made changes in main code as provided previously


<?php while ( osc_has_categories() ) { ?>
                        <div class="category">
                            <img class="expand" src="<?php echo osc_current_web_theme_url ; ?>" class="expand" />
                            <h1><strong><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</span></strong></h1>
                            <?php if ( osc_count_subcategories() > 0 ) { ?>
                                <ul>
                                    <?php while ( osc_has_subcategories() ) { ?>
                                        <li><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</span></li>
                                    <?php } ?>
                                </ul>
                            <?php } ?>
                        </div>
                        <?php





And after <meta.... add this:

<script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                $.each($('.category ul'), function(index, value) {
                    $(this).hide();
                });

                $('.category h1').live('click', function() {
                    $(this).parent().find('ul').toggle('slow');
                });
            })
        </script>



I wanted by hover so i made change in meta as

$('.category h1').live('hover', function() {
                    $(this).parent().find('ul').toggle('slow');
                });

but now there is a problem when i remove my mouse from category to sub categories then the sub categories are also disappear .

my website is www.tugalpur.com


please help me !
thanks in anticipation :)
« Last Edit: September 16, 2012, 11:46:20 pm by adminrahul »

sigivr

  • Sr. Member
  • ****
  • Posts: 471
hey i see you fixed the scroll bar for subcategories, would you share how u do it? i want to to do that aswell, have the main categories, and if i click on, show the subcategories, help me please

adminrahul

  • Newbie
  • *
  • Posts: 14
hello

use dis code




<?php while ( osc_has_categories() ) { ?>
                        <div class="category">
                            <img class="expand" src="<?php echo osc_current_web_theme_url ; ?>" class="expand" />
                            <h1><strong><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</span></strong></h1>
                            <?php if ( osc_count_subcategories() > 0 ) { ?>
                                <ul>
                                    <?php while ( osc_has_subcategories() ) { ?>
                                        <li><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</span></li>
                                    <?php } ?>
                                </ul>
                            <?php } ?>
                        </div>
                        <?php





And after <meta.... add this:

<script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                $.each($('.category ul'), function(index, value) {
                    $(this).hide();
                });

                $('.category h1').live('click', function() {
                    $(this).parent().find('ul').toggle('slow');
                });
            })
        </script>

sigivr

  • Sr. Member
  • ****
  • Posts: 471
thanks i got the scroll but not i dont have any image look at my site www.ofertaencaliente.com