added resizing of content window
This commit is contained in:
@@ -2,7 +2,7 @@ $(function() {
|
||||
// Table striping
|
||||
$(".striped tbody tr:even").addClass("even");
|
||||
$(".striped tbody tr:odd").addClass("odd");
|
||||
|
||||
|
||||
// More link
|
||||
if ($("#site-map-link").length > 0) {
|
||||
$("#site-map-link").click(function(e) {
|
||||
|
||||
29
app/assets/javascripts/layout.js
Normal file
29
app/assets/javascripts/layout.js
Normal file
@@ -0,0 +1,29 @@
|
||||
(function() {
|
||||
Danbooru.Layout = {};
|
||||
|
||||
Danbooru.Layout.initialize = function() {
|
||||
$(window).resize(Danbooru.Layout.restyle_content);
|
||||
}
|
||||
|
||||
Danbooru.Layout.restyle_content = function() {
|
||||
if ($(window).width() > 1100) {
|
||||
$("#content").css("max-width", "50em");
|
||||
}
|
||||
|
||||
if ($(window).width() > 1300) {
|
||||
$("#content").css("max-width", "60em");
|
||||
}
|
||||
|
||||
if ($(window).width() > 1500) {
|
||||
$("#content").css("max-width", "70em");
|
||||
}
|
||||
|
||||
if ($(window).width() < 1000) {
|
||||
$("#content").css("max-width", "40em");
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
$(document).ready(function() {
|
||||
Danbooru.Layout.initialize();
|
||||
});
|
||||
@@ -46,7 +46,7 @@ div#page {
|
||||
}
|
||||
|
||||
section#content {
|
||||
width: 80%;
|
||||
max-width: 50em;
|
||||
float: left;
|
||||
padding-left: 2em;
|
||||
overflow: visible;
|
||||
|
||||
Reference in New Issue
Block a user