-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
44 lines (23 loc) · 1.12 KB
/
script.js
File metadata and controls
44 lines (23 loc) · 1.12 KB
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
43
44
function updateOutput(){
$("iframe").contents().find("html").html("<html><head><style type='text/css'>" + $("#csspannel").val() + "</style></head><body>" +$("#htmlpannel").val() + "</body></html>");
document.getElementById("outputpannel").contentWindow.eval($("#javascriptpannel").val());
}
$(".toggleButton").hover(function() {
$(this).addClass("highlightedButton");
},function(){
$(this).removeClass("highlightedButton");
});
$(".toggleButton").click(function(){
$(this).toggleClass("active");
$(this).removeClass("highlightedButton");
var pannelId=$(this).attr("id") + "pannel";
$("#" +pannelId).toggleClass("hidden");
var numberOfActivePannels=4-$('.hidden').length;
$(".pannel").width(($(window).width() / numberOfActivePannels)-10);
});
$(".pannel").height($(window).height()-$("#header").height()-15);
$(".pannel").width(($(window).width()/2-5));
updateOutput();
$("textarea").on('change keyup paste', function() {
updateOutput();
});