-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
56 lines (23 loc) · 911 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function updateOutput(){
$("iframe").contents().find("html").html("<html><head><style type='text/css'>" + $("#cssp").val() +
"</style></head><body>" + $("#htmlp").val() + "</body></html>");
document.getElementById("outputp").contentWindow.eval($("#jsp").val());
}
$(".btn").hover(function(){
$(this).addClass("highlighted");
},function(){
$(this).removeClass("highlighted");
})
$(".btn").click(function(){
$(this).toggleClass("active");
$(this).removeClass("highlighted");
var panel = $(this).attr("id")+"p";
$("#"+panel).toggleClass("hidden");
var numberOfActivePanels = 4 - $('.hidden').length;
$(".panel").width(($(window).width() / numberOfActivePanels) - 10);
})
$(".panel").height($(window).height()-$("#header").height());
updateOutput();
$("textarea").on('change keyup paste', function() {
updateOutput();
});