Skip Navigation

[Resolved] Jquery not working after filter selected

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by matthewL-6 7 years ago.

Assisted by: Minesh.

Author
Posts
#600975

I am trying to: create a hover effect that hides an element on hover for 5 seconds and then reveals a gallery. which is positioned under the element.

I have used jQuery and it seems to work however when I select a filter option the archive filters as expected but my jquery no longer works even though all the classes seem in place.

Link to a page where the issue can be seen:
When the URL is normal they jquery works
hidden link

after the filter selection the jquery does not work
hidden link

Any help would be much appreciated.

#601004

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - I can see the issue with the link you shared but I would like to know hat jQuery code you've added which is not working after you select the filter?

Actually, view offers AJAX callback which you should use in such cases to bind your jQuery. When you visit view's Filter section's JS box - you will see a button "Frontend Events". When you click it it will allow you to choose ajax callback events for parametric search.

Refer this image:
=> hidden link

For example:

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
        
YOUR CUSTOM CODE GOES HERE
       
});
#601080

Ok, Thank you I had added my code to the head of my theme, as usually I like to keep everything together. I have now added it to the layout section as it is for the layout and not the filter and it is working...
Thank you for the pointers

#601090

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Glad to know that its working for you. You can mark this ticket resolved.

#602026

Thank you for the help.

Merry Christmas to you all have a great new year. Talk more in 2018 I am sure.