fix layout js

This commit is contained in:
albert
2013-02-17 22:21:05 -05:00
parent 54625aa79c
commit 693627d3c9
4 changed files with 16 additions and 15 deletions

View File

@@ -2,24 +2,27 @@
Danbooru.Layout = {};
Danbooru.Layout.initialize = function() {
$(window).resize(Danbooru.Layout.restyle_content);
if ($("#c-posts").length && $("#a-index").length) {
$(window).resize(Danbooru.Layout.restyle_content);
Danbooru.Layout.restyle_content();
}
}
Danbooru.Layout.restyle_content = function() {
if ($(window).width() > 1100) {
$("#content").css("max-width", "50em");
}
$("#content").css("width", "50em");
}
if ($(window).width() > 1300) {
$("#content").css("max-width", "60em");
}
$("#content").css("width", "60em");
}
if ($(window).width() > 1500) {
$("#content").css("max-width", "70em");
}
$("#content").css("width", "70em");
}
if ($(window).width() < 1000) {
$("#content").css("max-width", "40em");
$("#content").css("width", "40em");
}
}
})();