简体   繁体   中英

Change jQuery click event (this)

I dont know a lot about js and jQuery.

I bought a WP theme and I want to do a few changes on it.

In this page: https://websitesdevs.com/search-services/

You can see a div with a text saying "Apply Filters" and when you click on it, it opens a popup with all the filters. The thing is that I want a search box, and then a button to open this popup with the filters.. I've been trying it but I can't do it.. I would like to open that popup with any other CSS class. Do you know how can I do it?

I think that the popup opens with this JS & jQuery script

    //filter dropdown
jQuery('.mmobile-floating-apply,.wt-mobile-close').on('click', function() {
    var _this = jQuery(this);
    _this.parents('aside.wt-sidebar').toggleClass('show-mobile-filter');
});

This code is located at workreap_callbacks.js

Thanks for your time, I really need this

As far as I understand your question, you can run this:

$('.mmobile-floating-apply,.wt-mobile-close')
  .parents('aside.wt-sidebar')
  .toggleClass('show-mobile-filter');

from any place in your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM