|
@@ -12,8 +12,8 @@ angular.module('app').controller('PageViewController', ['$scope', function($scop
|
|
|
tel: '0578-2021088',
|
|
|
email: 'kehu01@wswin.cn',
|
|
|
};
|
|
|
-
|
|
|
$scope.$on('$viewContentLoaded', function() {
|
|
|
+ //加载屏幕适应
|
|
|
var clientWidth = document.documentElement.clientWidth || window.innerWidth;
|
|
|
var innerWidth = Math.max(Math.min(clientWidth, 600), 320);
|
|
|
var imgNum = $("#imgpreview").find('img').length;
|
|
@@ -52,7 +52,32 @@ angular.module('app').controller('PageViewController', ['$scope', function($scop
|
|
|
angular.element(".images").removeClass("two");
|
|
|
angular.element(".images").addClass("three");
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
+ //加载拖拽功能模块
|
|
|
+ var oBox = $(".modal-backdrop")[0],
|
|
|
+ odrop = $(".viewModal")[0];
|
|
|
+ console.log($(odrop));
|
|
|
+ odrop.onmousedown = function(e) {
|
|
|
+ var oClientX = (e || event).clientX; //鼠标位置距离最左端长度
|
|
|
+ var oLeftX = odrop.offsetLeft; //line相对父元素的长度
|
|
|
+ console.log((e || event));
|
|
|
+ document.onmousemove = function(e) {
|
|
|
+ var LeftX = oLeftX + ((e || event).clientX - oClientX);
|
|
|
+ var e = e || window.event;
|
|
|
+ odrop.style.margin = 0;
|
|
|
+ // LineX < 150 && (LineX = 150);
|
|
|
+ // LineX > 300 && (LineX = 300);
|
|
|
+ odrop.style.left = LeftX + "px";
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ document.onmouseup = function() {
|
|
|
+ document.onmousemove = null;
|
|
|
+ document.onmouseup = null;
|
|
|
+ odrop.releaseCapture && odrop.releaseCapture(); //将鼠标事件退回
|
|
|
+ };
|
|
|
+ odrop.setCapture && odrop.setCapture(); //将后续的mouse事件都发送给当前对象
|
|
|
+ return false;
|
|
|
+ };
|
|
|
});
|
|
|
|
|
|
$scope.imgView = function(event) {
|