Tagged: jQuery
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.