Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #2743422
How to add custom jquery to theme
Closed

Comments

  • jakegroup started the conversation

    Hi I would like to add custom jquery to the theme. I found that I can add custom JS in the Advanced options, but what is the correct way to add Jquery code (jQuery prefix)?

    I tried the following, but none of them worked.

    jQuery( document ).ready(function() {
        console.log( "ready!" );
    });

    $( document ).ready(function() {
        console.log( "ready!" );
    });

    $j( document ).ready(function() {
        console.log( "ready!" );
    });

    Thanks,

  •  7,280
    Oliver replied

    Hi,

    Example:

    (function($){
        $(function(){
        console.log( "ready!" );
    })})(jQuery);
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver