Home » Posts » Plugin » Output Environments » Javascript » Using JavaScript View
Using JavaScript View
Last updated on September 24, 2020 XD, PSD, AI and INDD layers to JS with clean and clear code becomes simple. Translate your XD, PSD, AI and INDD layers to JS with advanced support for text, images and shapes.
Example Image Element
1
2
3
4
5
6
7
8
9
| var index_button_bg = (navigator.userAgent.toLowerCase().indexOf("msie") != -1) ? new Image() : document.createElement("img");
index_button_bg.id = "index_button_bg";
index_button_bg.style.left = "927px";
index_button_bg.style.top = "1311px";
index_button_bg.style.width = "143px";
index_button_bg.style.height = "51px";
index_button_bg.src = "../skins/ek126_1001_wordpress_bluebox_theme/index_button_bg.png";
document.body.appendChild(index_button_bg); |
Example Text Element
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| var page_title = document.createElement("div");
page_title.innerHTML = "Toronto’s award winning <br/>creative agency";
page_title.style.fontWeight = "bold";
page_title.style.textAlign = "left";
page_title.id = "page_title";
page_title.style.left = "98px";
page_title.style.top = "131px";
page_title.style.width = "888px";
page_title.style.height = "188px";
page_title.style.fontFamily = "ArialMT, Arial, Helvetica, sans-serif";
page_title.style.fontSize = "72px";
page_title.style.color = "#FFFFFF";
document.body.appendChild(page_title); |
Example Shape Element
1
2
3
4
5
6
7
8
9
| var base = document.createElement("div");
base.id = "base";
base.style.left = "124px";
base.style.top = "1590px";
base.style.width = "422px";
base.style.height = "175px";
base.style.background = "#FFFFFF";
document.body.appendChild(base); |
customize the JS View to include additional information with the XD, PSD, AI and INDD layer such as effects, advanced text rendering and more.
Example Layer Effects
1
2
3
4
5
6
7
8
9
10
11
12
13
| var base = document.createElement("div");
base.id = "base";
base.style.left = "124px";
base.style.top = "1590px";
base.style.width = "422px";
base.style.height = "175px";
base.style.MozBoxShadow = "inset 2px 3px 3px 0px rgba(255,255,255,1)";
base.style.webkitBoxShadow = "inset 2px 3px 3px 0px rgba(255,255,255,1)";
base.style.boxShadow = "inset 2px 3px 3px 0px rgba(255,255,255,1)";
base.style.border = "3px solid #409EC1";
base.style.background = "#FFFFFF";
document.body.appendChild(base); |
LOGIN NOW: Get instant access to our free Online Training - click here.