Hi,
I've read the instructions here : http://laytheme.com/documentation.html#custom-javascript
I'm working on a site with heavy Javascript and CSS customization, so declaring the CSS and Javascript globally is really slowing down everything.
Ideally it would be best to only include the CSS/JS on the relevant page, but the +HTML option seems to not work for CSS or JS
I would like to specify some CSS and JS for each page and not have it load globally.
The format you suggest is :
<script>
window.laytheme.on("newpageshown", function(layoutObj, type, obj){
if(type == "project" && obj.id == 1){
...
}
});
</script>
Is there a way to
- use the +HTML to include page specific CSS/JS
- if not, a more direct formatting (without using if statements)
something like what we use for page specific CSS
.slug-home .class {}
I've tried to send the slug as a variable, but doesn't work.
Thanks for the help as usual,
Daniel