• i have this code

    $('.beton').click(function(){
    $('#menuu,.close-button').fadeIn();
    $('body').addClass('hilang');
    });
    
    $('.close-button').click(function(){
    $('#menuu,.close-button').fadeOut(300);
    $('body').removeClass('hilang');
    });

    and i test in localhost not work, i click button don’t fadeIn element

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Already I can see that you’re not using jQuery in noConflict mode.

    Try this at the very top of your code:

    $ = jQuery;

    Thread Starter syafiq18

    (@syafiq18)

    hey andrew can i ask again? i have genesis theme, and i want to save script related post, where i can save the code?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You’ll need to talk to your theme’s vendors about that, or anything specific to your theme.

    Thread Starter syafiq18

    (@syafiq18)

    Oh ok Btw this code

    <script type="text/javascript">
    $q=jQuery.noConflict();
    $q(document).ready(function(){
    $q(document).ready(function(){
    $q(".beton").click(function(){
    $q("#menuu,.close-button").fadeIn();
    $q("body").addClass("hilang");
    });
    $q(".close-button").click(function(){
    $q("#menuu,.close-button").fadeOut(300);
    $q("body").removeClass("hilang");
    });
    });
    </script>

    Still not work, i save that code above </head>

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘jquery not work’ is closed to new replies.