Javascript in section
You can refer to the code below to write javascript in .lh files
1
{section-folder}/section.lh
2
3
@schema
4
{
5
"name" : "First Section",
6
"author" : "LayoutHub Team",
7
"website" : "https://www.LayoutHub.com",
8
"version" : "1.0",
9
"vendors" : {
10
"hub_vendor_css": "assets/css/base.css"
11
},
12
"configs" : {}
13
}
14
@endschema
15
16
<div class="lh-container">
17
<div>Your first setting is {{section.settings.first}}</div>
18
</div>
19
20
@javascript
21
/* Javascript code in here */
22
alert('This is demo section');
23
@endjavascript
Copied!
Last modified 2yr ago
Copy link