Tagged: , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #209081

    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

    #209088

    Hi z2h!

    This would be the best way to add it in: http://wordpress.org/plugins/custom-javascript-editor/

    Regards,
    Devin

    #209097

    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

    #209111

    Hey!

    Please post a link to your website – I’ll check the code in avia.js

    Best regards,
    Peter

    #209118
    This reply has been marked as private.
    #209198

    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
    });
    #209354

    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

    • This reply was modified 10 years, 10 months ago by z2h.
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Where to put custom js / jquery’ is closed to new replies.