Tuesday, 15 September 2015

javascript - Change a style property with Jade html language? -



javascript - Change a style property with Jade html language? -

with code below, written in jade, thought able alter div id="content" referencing it's id , setting new style. when view results of running code in browser however, content visible instead of beingness hidden. can give me insight doing wrong , how correctly accomplish hiding element so?

extends layout block content #content h5 content test script. var searchvis = "visibility:" + search || "visibility:hidden"; var uploadvis = "visibility:" + upload || "visibility:hidden"; document.getelementbyid("content").style.visibility = "hidden";

when tried jade markup now, script fails because have not declared search or upload variables. can see error if utilize f12 dev tools in browser.

the next works fine me jade 1.3.1:

extends layout block content #content h5 content test script. var search="";var upload=""; var searchvis = "visibility:" + search || "visibility:hidden"; var uploadvis = "visibility:" + upload || "visibility:hidden"; document.getelementbyid("content").style.visibility = "hidden";

javascript css html5 jade

No comments:

Post a Comment