Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
marcorensch authored Feb 15, 2017
1 parent 34ec24f commit c72fe86
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions responzer/responzer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Stylesheet for Responzer.js
*/
.responzer {
min-width: 100% !important;
width: 100% !important;
height: auto;
min-height: auto;
}
28 changes: 28 additions & 0 deletions responzer/responzer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Responzer.js
*/

function responzer(selector) {
"use strict";
jQuery(selector).each(function () {
var container = jQuery(this),
ratio = 5,
content = container.children(),
containerw = container.width(),
containerh = containerw / ratio;
container.css({'min-height': containerh + 'px', 'width': containerw + 'px'});
content.css({'height': containerh + 'px', 'width': containerw + 'px'});
content.attr({'height': containerh + 'px', 'width': containerw + 'px'}); // needed if content is iframe
});
}

jQuery(document).ready(function () {
"use strict";
responzer('.responzer');
});
jQuery(window).resize(function () {
"use strict";
responzer('.responzer');
});

0 comments on commit c72fe86

Please sign in to comment.