Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------
- // Ico
- // When you have iFrame with fixed height and the client wants it responsove,
- // this is how you (t)roll
- // 1200 is the breakpoint
- // $holderElement is the wrapper element
- // You need jQuery and TweenLite included
- //--------------------------------------------------------------
- var isResponsive = true;
- if (isResponsive) {
- var $holderElement = $('.app__holder');
- var $window = $(window);
- var isMobile = $window.width() < 1200;
- var scaleRatio = 1;
- TweenLite.set($holderElement, {transformOrigin: '0 50%'});
- $(window).on('resize', function () {
- var winWidth = $window.width();
- if (winWidth < 1200) {
- isMobile = true;
- scaleRatio = winWidth / 1200;
- } else {
- if (isMobile) {
- isMobile = false;
- scaleRatio = 1;
- }
- }
- TweenLite.set($holderElement, {scale: scaleRatio});
- }).trigger('resize');
- }
Advertisement
Add Comment
Please, Sign In to add comment