HetaJs

Zooming

가나다라마바사아자차
가나다라마바사아자차
가나다라마바사아자차
가나다라마바사아자차
가나다라마바사아자차
가나다라마바사아자차
가나다라마바사아자차

Script

/**
* .
*/
var Zooming = {
auto: false, // .
rectWidth : 1424,
rectHeight: 730,
zoomTarget : "", //".zoom"
init : function(selector,isAuto){
if(selector !== undefined) this.zoomTarget =selector; //"#arcContainer"
if(isAuto !== undefined) this.auto = isAuto;
if(this.auto){
//
$(window).resize(function () {
Zooming.autoResize();
});
this.autoResize();
}
},
//
zoomIn : function(per){
var old_per = $(this.zoomTarget).css('zoom');
var n = Number(old_per.replace("%",""));
if(per === undefined) per = 10;
this._changeSize((n + per) +"%");
},
//
zoomOut : function(per){
var old_per = $(this.zoomTarget).css('zoom');
var n = Number(old_per.replace("%",""));
if(per === undefined) per = 10;
this._changeSize((n - per) +"%");
},
autoResize : function() {
var scale = this._getScale();
if(scale.x > 1){
this._resetSize();
}else{
this._changeSize(scale.x); //x .
}
},
// zoom .
_getScale : function(){
var swidth = $(window).width();
var sheight = $(window).height();
var scaleX = 1;
var scaleY = 1;
scaleX = swidth / this.rectWidth;
scaleY = sheight / this.rectHeight;
return {x:scaleX,y:scaleY};
},
_resetSize: function(){
$(this.zoomTarget).css({'zoom': 1,'position':'absolute'});
$("body").css("overflow-x","auto"); //
},
_changeSize : function(scale){
$(this.zoomTarget).css({'zoom': scale,'position':'absolute'});
$("body").css("overflow-x","hidden"); // .
},
ResetSize : function(){
this._resetSize();
},
MatchSize : function(){
this._changeSize(this._getScale().x); //x .
}
};
// $(function () {
// Zooming.init();
// });
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX