For whatever reason ths works when run from console:
var wh=window.innerHeight;
var h= wh-345;
$('.hidehome').attr('style', 'display:block;height:'+h+'px;width:100%');
but this doesn’t:
$(document).ready(function() {
var wh=window.innerHeight;
var h= wh-345;
$('.hidehome').attr('style', 'display:block;height:'+h+'px;width:100%'); )};
I have no idea why. Console tells me
Syntax error at line 4: expected expression, got ')'
h+'px;width:100%'); )};
--------------------^
Which obviously means something is wrong with my code, but I still can’t figure it out.
Your parenthesis and curly brace need to be switched around:
Also, consider using the
cssmethod: