사용자함수 화면에 맞게 페이지 리사이징
페이지 정보
작성자 너갱이 작성일 18-11-18 17:08 조회 2,376 댓글 0본문
//리사이징 추가부분
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()}); //스크롤방지
댓글목록 0
등록된 댓글이 없습니다.
