mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
28 lines
896 B
JavaScript
28 lines
896 B
JavaScript
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
|
|
//>>description: Utility methods for enabling and disabling user scaling (pinch zoom)
|
|
//>>label: zoomhandling
|
|
|
|
define( [ "jquery", "jquery.mobile.core" ], function( $ ) {
|
|
//>>excludeEnd("jqmBuildExclude");
|
|
( function( $ ) {
|
|
var meta = $( "meta[name=viewport]" ),
|
|
initialContent = meta.attr( "content" ),
|
|
disabledZoom = initialContent + ",maximum-scale=1",
|
|
enabledZoom = initialContent + ",maximum-scale=10";
|
|
|
|
$.mobile.zoom = $.extend( {}, {
|
|
enabled: true,
|
|
disable: function() {
|
|
meta.attr( "content", disabledZoom );
|
|
$.mobile.zoom.enabled = false;
|
|
},
|
|
enable: function() {
|
|
meta.attr( "content", enabledZoom );
|
|
$.mobile.zoom.enabled = true;
|
|
}
|
|
});
|
|
|
|
}( jQuery ));
|
|
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
|
|
});
|
|
//>>excludeEnd("jqmBuildExclude");
|