Hi guys,
Im updating my website and I would like to add some custom Jquery only i cannot find where to place it..
$('#floatnav a').click(function() {
$('#floatnav a').removeClass('active'); /*Remove previous*/
$(this).addClass('active'); /*Active clicked*/
})
I tried putting it on the bottom of avia.js but that didnt work at all.
Thx
Hi z2h!
This would be the best way to add it in: http://wordpress.org/plugins/custom-javascript-editor/
Regards,
Devin
Hi Devin,
Thanks but I seem to get no luck by using that plugin tho.. The code works perfect, it runs smoothly in Jsfiddle http://jsfiddle.net/ELMeQ/
Do I have any other options?
Thx,
Nick
Hey!
Please post a link to your website – I’ll check the code in avia.js
Best regards,
Peter
See: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers
So wrapping it with this (from the codex example) should allow you to use the same script but without causing an issue with WordPress:
jQuery(document).ready(function($) {
// Inside of this function, $() will work as an alias for jQuery()
// and other libraries also using $ will not be accessible under this shortcut
});
Hi Devin,
Thanks for the answer but I still dont get where to place the code in… Do I place it in the (wp-includes/js/jquery/jquery.js) folder ? Or do I combine the code you provided with mine in the Javascript Plugin?
EDIT:
Nevermind got it working :) THX!
Nick