*

pitbull

  • ***
  • 98 posts
Hi, there are some drop down fields like (transaction, condition, period, categories) at the sidebar search or at the home page top search that opens when i hover them with the mouse cursor. How can i make them open only when someone clicks on them ??? I find that this behavior is some kind of annoying for me :)

Thanks in advance.

*

MB Themes

Re: How can i make drop down fields open on click and not on hover ???
« Reply #1 on: September 22, 2017, 10:36:53 AM »
@pitbull
In global.js locate this code:
Code: [Select]
  $('body').on('mouseenter', '.simple-select', function() {
    if( !$(this).hasClass('disabled') ) {
      $(this).find('.list').fadeIn(200);
    }
  }).on('mouseleave', '.simple-select', function() {
    if( !$(this).hasClass('disabled') ) {
      $(this).find('.list').fadeOut(200);
    }
  });

And change it to:
Code: [Select]
  $('body').on('click', '.simple-select', function(e) {
    if( !$(this).hasClass('disabled') ) {
      e.preventDefault();
      $(this).find('.list').fadeToggle(200);
      return false;
    }
  });

There might be some other adjustments required, those are on you ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pitbull

  • ***
  • 98 posts
Re: How can i make drop down fields open on click and not on hover ???
« Reply #2 on: September 22, 2017, 01:00:48 PM »
@pitbull
In global.js locate this code:
Code: [Select]
  $('body').on('mouseenter', '.simple-select', function() {
    if( !$(this).hasClass('disabled') ) {
      $(this).find('.list').fadeIn(200);
    }
  }).on('mouseleave', '.simple-select', function() {
    if( !$(this).hasClass('disabled') ) {
      $(this).find('.list').fadeOut(200);
    }
  });

And change it to:
Code: [Select]
  $('body').on('click', '.simple-select', function(e) {
    if( !$(this).hasClass('disabled') ) {
      e.preventDefault();
      $(this).find('.list').fadeToggle(200);
      return false;
    }
  });

There might be some other adjustments required, those are on you ;)


Thank you. I ll try it asap ;)

*

Ivanko

  • *****
  • 391 posts
Re: How can i make drop down fields open on click and not on hover ???
« Reply #3 on: December 12, 2017, 07:14:51 PM »
I have opposite question how to use simple select for extra custom fields ?)

The code in searh.php

Code: [Select]
<div class="sidebar-hooks">
              <?php 
                
GLOBAL $search_hooks;

                
ob_start(); // SAVE HTML

                
if(osc_search_category_id()) { 
                  
osc_run_hook('search_form'osc_search_category_id());
                } else { 
                  
osc_run_hook('search_form');
                }

                
//echo $search_hooks;
                
$search_hooks ob_get_contents();   // CAPTURE HTML OF SIDEBAR HOOKS FOR FOOTER (MOBILE VIEW)
              
?>

            </div>

*

MB Themes

Re: How can i make drop down fields open on click and not on hover ???
« Reply #4 on: December 12, 2017, 07:16:22 PM »
@Ivanko
For each select box exist function to create nice select, there is no "general" function you could apply on group of select boxes.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dreamson

  • *
  • 4 posts
Re: How can i make drop down fields open on click and not on hover ???
« Reply #5 on: December 29, 2017, 04:18:32 PM »
i TRIED this and it works but whenever i click the dropdown and made a selection, the dropdown list is still there

*

MB Themes

Re: How can i make drop down fields open on click and not on hover ???
« Reply #6 on: December 29, 2017, 08:10:50 PM »
@dreamson
Because you hover it.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots