-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34ec24f
commit c72fe86
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); |