Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Dante
  • #111430
    consult-one
    Member
    Post count: 78

    Hi there,

    i tried adding a simple javascript funtion to the custom.js but it won’t work. Can you tell me why

    $(document).ready( function () {
    $(“h2”).click( funtion() {
    $(“h2”).css(“background-color” , “red”);
    });
    });

    Thanks

    #111568
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to use this code at Admin -> Theme Options -> Custom CSS/JS :-

    <script>
    jQuery(document).ready( function ($) {
    $('h2').click( funtion() {
    $('h2').css('background-color' , 'red');
    });
    });
    </script>

    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    #111581
    consult-one
    Member
    Post count: 78

    Hm, wehn i insert this in the custom.js the h2 won’t turn red when clicking on them

    #111590
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me specific page url so i can check and resolve the issue.
    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    #113102
    consult-one
    Member
    Post count: 78
    This reply has been marked as private.
    #113196
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove last one code and use this one correct code:-

    jQuery(document).ready( function ($) {
    $("h2").click( function() {
    $("h2").css('background-color' , 'red');
    });
    });

    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    #113494
    consult-one
    Member
    Post count: 78

    Somehow it still wont work…

    #113522
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove last code and wrap this code with script tag.

    <script>
    jQuery(document).ready( function ($) {
    $("h2").click( function() {
    $("h2").css('background-color' , 'red');
    });
    });
    </script>

    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register