사용자함수 화면에 맞게 페이지 리사이징
페이지 정보

본문
//리사이징 추가부분
var scale;
var real_height;
$(function ()
{
//리사이징 처리
var contentWidth = 1280;
var contentHeight = 720;
$("#wrap").css({"transform-origin":"top left", "-webkit-transform-origin":"top left", "-ms-transform-origin":"top left"});
$(window).on("resize", function ( e )
{
var winWidth = $(window).width();
var winHeight = $(window).height();
var scaleX = winWidth/contentWidth;
var scaleY = winHeight/contentHeight;
scale = Math.min(scaleX, scaleY);
var left = (winWidth-(contentWidth*scale))/2;
var top = (winHeight-(contentHeight*scale))/2;
TweenLite.set($("#wrap"), {scaleX:scale, scaleY:scale, left:left, top:top, force3D:true});
TweenLite.set($(".scale_layer"), {height:(contentHeight*scale)+top});
window.scale = 1/scale;
//window.scale = 1;
real_height = winHeight;
});
$(window).trigger("resize");
setTimeout(function (){
$(window).trigger("resize");
}, 10);
});
$("body").bind('touchmove', function(e){e.preventDefault()}); //스크롤방지
- 이전글자바스크립트를 사용하여 CSS 바꾸기 18.11.18
- 다음글모바일 체크 18.11.18
댓글목록
등록된 댓글이 없습니다.

