WebContent/resource/js/imagezoom.js
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* ImageZoom Plugin
* http://0401morita.github.io/imagezoom-plugin
* MIT licensed
*
* Copyright (C) 2014 http://0401morita.github.io/imagezoom-plugin A project by Yosuke Morita
*/
(function($){
var defaults = {
cursorcolor:'255,255,255',
opacity:0.5,
cursor:'crosshair',
zindex:2147483647,
zoomviewsize:[480,395],
zoomviewposition:'right',
zoomviewmargin:10,
zoomviewborder:'none',
magnification:1.925
};
var imagezoomCursor,imagezoomView,settings,imageWidth,imageHeight,offset;
var methods = {
init : function(options){
$this = $(this),
imagezoomCursor = $('.imagezoom-cursor'),
imagezoomView = $('.imagezoom-view'),
$(document).on('mouseenter',$this.selector,function(e){
var data = $(this).data();
settings = $.extend({},defaults,options,data),
offset = $(this).offset(),
imageWidth = $(this).width(),
imageHeight = $(this).height(),
cursorSize = [(settings.zoomviewsize[0]/settings.magnification),(settings.zoomviewsize[1]/settings.magnification)];
if(data.imagezoom == true){
imageSrc = $(this).attr('src');
}else{
imageSrc = $(this).get(0).getAttribute('data-imagezoom');
}
var posX = e.pageX,posY = e.pageY,zoomViewPositionX;
$('body').prepend('<div class="imagezoom-cursor"> </div><div class="imagezoom-view"><img src="'+imageSrc+'"></div>');
if(settings.zoomviewposition == 'right'){
zoomViewPositionX = (offset.left+imageWidth+settings.zoomviewmargin);
}else{
zoomViewPositionX = (offset.left-imageWidth-settings.zoomviewmargin);
}
$(imagezoomView.selector).css({
'position':'absolute',
'left': zoomViewPositionX,
'top': offset.top,
'width': cursorSize[0]*settings.magnification,
'height': cursorSize[1]*settings.magnification,
'background':'#000',
'z-index':2147483647,
'overflow':'hidden',
'border': settings.zoomviewborder
});
后面还有 62 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
