Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26773

    Hi!

    I want to use small jQuery-Scripts on a page built with Layout Builder on enfold. After a little fiddeling I found out that I can write the scripts in a widget in a custom widget area and enclose it in some function:

    <script language=”javascript”>

    (function($)

    {

    “use strict”;

    $(document).ready(function(){

    alert(“page loaded”);

    });

    }(jQuery));

    Ok, thats nice, but I don’t want to bother the visitor with alerts :-) but say I wonna charge a specific link with a custom onclick event (hide the respective element and show another instead).

    For this to accomplish I need to set up a function which I can call e.g. via hide me

    But I can’t figure out where I have to place the function correctly. It doesn’t work anywhere within or outside the code above. Any help?

    @Kriesi: The perfect thing would be an element in Layout Builder which can contain Javascript-/jquery Statements and custom CSS for this particular page.

    #131557

    Hi,

    You can place it js > avia.js. All jquery scripts go that way, or add it on footer.php right before </body] tag.

    Regards,

    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How can I user jQuery in Layout Builder or in widgets?’ is closed to new replies.