I think most us are are familiar with the filtering post based on categories using ajax. But, if you still want to check out the way I write code to filter the posts continue reading this article 😛 .
Hits: 2443
I think most us are are familiar with the filtering post based on categories using ajax. But, if you still want to check out the way I write code to filter the posts continue reading this article 😛 .
Hits: 2443
Do you want to open all the external links of your website in a new tab ? If you say ‘YES“, just copy the following code and paste it in your function.php file.
Hits: 11
To open all the pdf’s in a new tab we shall write jQuery Script that sets the target=”_blank” for all .pdf extension in an anchor.
Hits: 11
Sometimes, it is handy to use jQuery to highlight the current menu. And for such cases you can write script that automatically add active class to the current menu:
1 |
jQuery('a[href*="'+window.location.href+'"]').addClass('current-menu'); |
If the menu to be highlighted is inside the container with class for eg. ‘main-nav’, then it would be good to add ‘.main-nav’ on the selector.
1 |
jQuery('.main-nav a[href*="'+window.location.href+'"]').addClass('current-menu'); |
Hits: 19