admin_orders_923_2
This commit is contained in:
@@ -453,7 +453,59 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
//图片放大缩小
|
||||
$(document).on("mousewheel DOMMouseScroll", ".layui-layer-phimg", function (e) {
|
||||
var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
|
||||
(e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox
|
||||
var imagep = $(".layui-layer-phimg").parent().parent();
|
||||
var image = $(".layui-layer-phimg").parent();
|
||||
var h = image.height();
|
||||
var w = image.width();
|
||||
var img_url = $("#imglayer").attr("src");
|
||||
// 创建对象
|
||||
var img = new Image();
|
||||
// 改变图片的src
|
||||
img.src = img_url;
|
||||
var width = img.width;
|
||||
var height = img.height;
|
||||
debugger;
|
||||
if (delta > 0) {
|
||||
if (h < (window.innerHeight)) {
|
||||
h = h * 1.05;
|
||||
w = w * 1.05;
|
||||
width = width*1.05;
|
||||
height = height*1.05;
|
||||
}
|
||||
} else if (delta < 0) {
|
||||
if (h > 100) {
|
||||
h = h * 0.95;
|
||||
w = w * 0.95;
|
||||
width = width*0.95;
|
||||
height = height*0.95;
|
||||
}
|
||||
}
|
||||
imagep.css("top", (window.innerHeight - h) / 2);
|
||||
imagep.css("left", (window.innerWidth - w) / 2);
|
||||
image.height(h);
|
||||
image.width(w);
|
||||
imagep.height(h);
|
||||
imagep.width(w);
|
||||
var current = $("#current").val();
|
||||
if((current/90)%2==1){
|
||||
$('#imglayer').css("width",h);
|
||||
$('#imglayer').css("margin-top",-(w-h)/2);
|
||||
if(height<width){
|
||||
$('#imglayer').css("margin-left",(w-h)/2);
|
||||
}
|
||||
}else{
|
||||
$('#imglayer').css("width",w);
|
||||
$('#imglayer').css("margin-top",0);
|
||||
if(height<width){
|
||||
$('#imglayer').css("margin-left",0);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.span-bold {
|
||||
|
||||
Reference in New Issue
Block a user