-1
<div class="navigation">
         <dt><?php echo $this->__($_filter->getName()) ?></dt>
         <dd><?php echo $_filter->getHtml() ?></dd>
    </div>

Script

<script type="text/javascript">
jQuery=$.noConflict();
jQuery(document).ready(function() {
    jQuery('.navigation dd').hide(); 

    jQuery('.navigation dt').hover(function(){ 
            jQuery(this).next('dd').slideToggle('slow');
            jQuery(this).toggleClass('glace_navigationlayer-collapsed'); 


        });


 }); 
</script>

If i goto dd it's automatically hide, entierely go out it should be hide what is the mistake i made here?

2

Below script may help you

<script type="text/javascript">
jQuery(function($){
     $(".block-layered-nav dt").click(function(){
     if($(this).next("dd").css("display") == "none"){
           $(this).next("dd").slideDown(200);
           $(this).removeClass("closed");
     } else {
           $(this).next("dd").slideUp(200);
           $(this).addClass("closed");
     }
     }); 
}); 
</script> 
  • No luck it's not working – Magento 2 Apr 5 '16 at 12:19
  • You can use click function like jsfiddle.net/pgsutariya/eq2vohfL/4 – PG Sutariya Apr 5 '16 at 12:23
  • here, once you hover dt it toggle dd but when you over hover state it will again hide dd – PG Sutariya Apr 5 '16 at 12:25
  • if click again then only it closed i need to close on leave that – Magento 2 Apr 5 '16 at 12:38
  • then you have to add mouse.leave function() of jQuery – PG Sutariya Apr 5 '16 at 12:48
2

Use below code change class name as per your html

<script type="text/javascript">
        jQuery = jQuery.noConflict();
    jQuery(document).ready(function(){
        jQuery('#narrow-by-list dd').each(function(){ 
            jQuery(this).hide();

        });
        jQuery('#narrow-by-list dt').mouseover(function(e){ 
                jQuery('#narrow-by-list dd').each(function(){ 
                    if(jQuery(this).css("display") != "none"){
                        jQuery(this).slideUp('slow');
                    }
                });
                jQuery(this).next('dd').slideDown('slow');         
        });
     });
  </script>
  • No luck it's not working – Magento 2 Apr 5 '16 at 12:19
  • check browser console.Is there any error post in question – Prashant Valanda Apr 5 '16 at 12:20
  • No error on this – Magento 2 Apr 5 '16 at 12:22
  • Updated answer check it. – Prashant Valanda Apr 5 '16 at 12:26
  • if i go to dd it hide – Magento 2 Apr 5 '16 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.