I have an idea, and I am not convinced that the interpreter is unable to handle it already, even then It sure does not happen. Therefore, my question is whether the interpreter already handles the idea that I am about to offer.
Specifically, what I would like to do, a style of javascript is in different places of the stylesheet. The JavaScript block should be able to access the scope of the CSS block, which it is in nested. Perhaps a sample code block will make it a little bit more pronounced.
.page {& lt; Script & gt; Target.header = document.createElement ('div'); Target.header.className = 'Page Header'; Target.header.heightPerc = 0.2; Target.header.widthPerc = 1; Target.header.height = target.clientHeight * target.header.heightPerc; Target.header.width = target.clientWidth * target.header.widthPerc; Target.header.style.height = (target.clientHeight * target.header.height) + 'px'; Target.header.style.width = (target.clientWidth * target.header.width) + 'px'; Target.header.style.borderBottom = '1px solid black'; Target.header.style.position = 'Done'; Target.header.style.top = '0px'; Target.header.style.left = ((target.clientWidth - target.header.width) / 2) + 'Px'; Target.appendChild ('target.header'); & Lt; / Script & gt; }
In my example, target
means having an existing element organized by the CSS selector
As As you can see, this is a CSS class selector with a block of JavaScript, which certainly does not work. The principle is that this block of JavaScript works as a template for each element taken by the CSS selector (similarly the angular .js is still compiled at the same time as CSS). Is there any way that can be done already (without the use of third party libraries or structures)
Another use I would like is something like this:
HTML:
& lt; Img class = "image1" & gt; & Lt; / Img & gt;
CSS:
.image1 {& lt; Script & gt; Target.src = "(url for image)"; & Lt; / Script & gt; }
If there is any current way of doing any of these things, please tell me! No, I do not think that it will work, it does something like that, but I do not think it's going to work. That's what you want.
& lt; Script & gt; Document.write ("& lt; Style & gt; Body {background: black}", gt;) & lt; / Script & gt;
Comments
Post a Comment