<!DOCTYPE html>
<html lang=\”zh\”>
<head>
<meta charset=\”UTF-8\”>
<meta http-equiv=\”X-UA-Compatible\” content=\”IE=edge,chrome=1\”>
<meta name=\”viewport\” content=\”user-scalable=no, width=device-width, initial-scale=1\”>
<title>jQuery图片整张或局部放大代码 </title>
<link rel=\”stylesheet\” href=\”css/bootstrap.min.css\” />
<link rel=\”stylesheet\” href=\”src/css/mag.css\” />
<link rel=\”stylesheet\” href=\”src/theme/default.css\” />
<link rel=\”stylesheet\” href=\”css/index.css\” />
<style type=\”text/css\”>
.controls-btns button{
color: #333;
}
.mt50{margin-top: 50px;}
</style>
</head>
<body>
<div class=\”container mt50\”>
<main>
<div class=\”row mag-eg-row\”>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-el-wrap img-thumbnail\”>
<div class=\”proportion\”>
<div mag-thumb=\”inner\” class=\”mag-eg-el\”>
<img src=\”img/alley/500×300.jpg\” />
</div>
<div mag-zoom=\”inner\” class=\”mag-eg-el\”>
<img src=\”img/alley/1000×600.jpg\” />
</div>
<div class=\”filler\”></div>
</div>
</div>
</div>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-doc\”>
<h3>Inner</h3>
<pre><code class=\”lang-html\”><!–
–><div mag-thumb="inner">
<img src="img/alley/500×300.jpg" />
</div>
<div mag-zoom="inner">
<img src="img/alley/1000×600.jpg" />
</div><!–
–></code></pre>
<pre><code class=\”lang-js\”><!–
–>$host = $(\'[mag-thumb="inner"]\’);
$host.mag();<!–
–></code></pre>
<p>使用鼠标滚轮可以对内部图片进行缩放。</p>
</div>
</div>
</div>
<div class=\”row mag-eg-row\”>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-el-wrap\”>
<div class=\”img-thumbnail\”>
<div mag-thumb=\”inner-inline\” mag-flow=\”inline\” class=\”mag-eg-el\”>
<img src=\”img/alley/500×300.jpg\” style=\”width: 400px; max-width: 100%; height: auto\” />
</div>
<div mag-zoom=\”inner-inline\” class=\”mag-eg-el\”>
<img src=\”img/alley/1000×600.jpg\” />
</div>
</div>
</div>
</div>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-doc\”>
<h3>Inner Inline</h3>
<pre><code class=\”lang-html\”><!–
–><div mag-thumb="inner-inline" mag-flow="inline">
<img src="img/alley/500×300.jpg" style="width: 400px; max-width:100%;" />
</div>
<div mag-zoom="inner-inline">
<img src="img/alley/1000×600.jpg" />
</div><!–
–></code></pre>
<pre><code class=\”lang-js\”><!–
–>$host = $(\'[mag-thumb="inner-inline"]\’);
$host.mag();<!–
–></code></pre>
</div>
</div>
</div>
<div class=\”row mag-eg-row\”>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-el-wrap img-thumbnail\”>
<div class=\”proportion\”>
<div mag-thumb=\”outer\” class=\”mag-eg-el\”>
<img src=\”img/rieti/500×334.jpg\” />
</div>
<div class=\”filler\”></div>
</div>
</div>
<div class=\”mag-eg-el-wrap img-thumbnail\” style=\”height:auto;width:auto\”>
<div style=\”height: 300px; width: 300px\”>
<div mag-zoom=\”outer\” class=\”mag-eg-el\” style=\”float: right;position:relative;overflow:hidden;\”>
<img src=\”img/rieti/full.jpg\” />
</div>
</div>
</div>
</div>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-doc\”>
<h3>Outer</h3>
<pre><code class=\”lang-html\”><!–
–><div mag-thumb="outer">
<img src="img/alley/500×300.jpg" />
</div>
<div style="width: 300px; height: 300px;">
<div mag-zoom="outer">
<img src="img/alley/1000×600.jpg" />
</div>
</div><!–
–></code></pre>
<pre><code class=\”lang-js\”><!–
–>$host = $(\'[mag-thumb="outer"]\’);
$host.mag({
mode: \’outer\’,
ratio: 1 / 1.6
});
</code></pre>
<p>使用鼠标滚轮可以对外部图片进行缩放。</p>
</div>
</div>
</div>
<div class=\”row mag-eg-row\”>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-el-wrap img-thumbnail\”>
<div class=\”proportion\”>
<div mag-thumb=\”outer-drag\” class=\”mag-eg-el\”>
<img src=\”img/rieti/500×334.jpg\” />
</div>
<div class=\”filler\”></div>
</div>
</div>
<div class=\”mag-eg-el-wrap img-thumbnail\”>
<div class=\”proportion\”>
<div mag-zoom=\”outer-drag\” class=\”mag-eg-el\” style=\”float: right;\”>
<img src=\”img/rieti/full.jpg\” />
</div>
<div class=\”filler\”></div>
</div>
</div>
</div>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-doc\”>
<h3>Outer Drag</h3>
<pre><code class=\”lang-html\”><!–
–><div mag-thumb="outer-drag">
<img src="img/alley/500×300.jpg" />
</div>
<div mag-zoom="outer-drag">
<img src="img/alley/1000×600.jpg" />
</div>
<!–
–></code></pre>
<pre><code class=\”lang-js\”><!–
–>$host = $(\'[mag-thumb="outer-drag"]\’);
$host.mag({
mode: \’outer\’,
position: \’drag\’,
toggle: false
});<!–
–></code></pre>
<p>使用鼠标滚轮可以对外部图片进行缩放。</p>
</div>
</div>
</div>
<div class=\”row mag-eg-row\”>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-el-wrap img-thumbnail\”>
<div class=\”proportion\”>
<div mag-thumb=\”drag\” class=\”mag-eg-el\”>
<img src=\”img/rieti/500×334.jpg\” />
</div>
<div mag-zoom=\”drag\” class=\”mag-eg-el\”>
<img src=\”img/rieti/full.jpg\” />
</div>
<div class=\”filler\”></div>
</div>
</div>
</div>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-doc\”>
<h3>Drag</h3>
<pre><code class=\”lang-html\”><!–
–><div mag-thumb="drag">
<img src="img/alley/500×300.jpg" />
</div>
<div mag-zoom="drag">
<img src="img/alley/1000×600.jpg" />
</div><!–
–></code></pre>
<pre><code class=\”lang-js\”><!–
–>$host = $(\'[mag-thumb="drag"]\’);
$host.mag({
position: \’drag\’,
toggle: false
});<!–
–></code></pre>
<p>使用鼠标滚轮可以对图片进行缩放。</p>
</div>
</div>
</div>
<div class=\”row mag-eg-row\” id=\”controls\”>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-el-wrap img-thumbnail\”>
<div class=\”proportion\”>
<div mag-thumb=\”controls\” class=\”mag-eg-el\”>
<img src=\”img/rieti/500×334.jpg\” />
</div>
<div mag-zoom=\”controls\” class=\”mag-eg-el\”>
<img src=\”img/rieti/full.jpg\” />
</div>
<div class=\”filler\”></div>
</div>
</div>
<div mag-ctrl=\”controls\” class=\”controls-btns\”>
<button class=\”mag-eg-ctrl-zoom-out\” mag-ctrl-zoom-by=\”-0.5\”>-</button>
<button class=\”mag-eg-ctrl-zoom-in\” mag-ctrl-zoom-by=\”0.5\”>+</button>
<button class=\”mag-eg-ctrl-move-up\” mag-ctrl-move-by-y=\”-0.5\”>^</button>
<button class=\”mag-eg-ctrl-move-down\” mag-ctrl-move-by-y=\”0.5\”>v</button>
<button class=\”mag-eg-ctrl-move-left\” mag-ctrl-move-by-x=\”-0.5\”><</button>
<button class=\”mag-eg-ctrl-move-right\” mag-ctrl-move-by-x=\”0.5\”>></button>
<button class=\”mag-eg-ctrl-fullscreen\” mag-ctrl-fullscreen>[ ]</button>
<button class=\”mag-eg-ctrl-destroy\” mag-ctrl-destroy>destroy</button>
</div>
</div>
<div class=\”col col-md-6\”>
<div class=\”mag-eg-doc\”>
<h3><a href=\”#controls\”>Controls</a></h3>
<pre><code class=\”lang-html\”><!–
–><script src=\”src/js/mag-control.js\”></script>
<div mag-thumb="controls">
<img src="img/alley/500×300.jpg" />
</div>
<div mag-zoom="controls">
<img src="img/alley/1000×600.jpg" />
</div>
<div mag-ctrl="controls">
<button mag-ctrl-zoom-by="-0.5">-</button>
<button mag-ctrl-zoom-by="0.5">+</button>
<button mag-ctrl-move-by-y="-0.5">^</button>
<button mag-ctrl-move-by-y="0.5">v</button>
<button mag-ctrl-move-by-x="-0.5"><</button>
<button mag-ctrl-move-by-x="0.5">></button>
<button mag-ctrl-fullscreen>[ ]</button>
<button mag-ctrl-destroy>destroy</button>
</div><!–
–></code></pre>
<pre><code class=\”lang-js\”><!–
–>$host = $(\'[mag-thumb="controls"]\’);
$host.mag(
toggle: false,
position: false
);
$controls = $(\'[mag-ctrl=\”controls\”]\’);
$controls.magCtrl({
mag: $host
});<!–
–></code></pre>
</div>
</div>
</div>
</main>
</div>
<script src=\”js/jquery.min.js\”></script>
<script src=\”js/jquery.bridget.js\”></script>
<script src=\”js/jquery.mousewheel.min.js\”></script>
<script src=\”js/jquery.event.drag.js\”></script>
<script src=\”js/screenfull.js\”></script>
<script src=\”js/hammer.min.js\”></script>
<script src=\”js/PreventGhostClick.js\”></script>
<script src=\”src/js/mag-analytics.js\”></script>
<script src=\”src/js/mag.js\”></script>
<script src=\”src/js/mag-jquery.js\”></script>
<script src=\”src/js/mag-control.js\”></script>
<script src=\”js/index.js\”></script>
<div style=\”text-align:center;margin:50px 0; font:normal 14px/24px \’MicroSoft YaHei\’;\”>
</div>
</body>
</html>
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"www.qnziyw.cn",如遇到无法解压的请联系管理员!
青柠资源网 » H5的图片整张或局部放大特效
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍
- 提示下载完但解压或打开不了?
- 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用百度网盘软件或迅雷下载。 若排除这种情况,可在对应资源底部留言,或 联络我们。
- 找不到素材资源介绍文章里的示例图片?
- 对于会员专享、整站源码、程序插件、网站模板、网页模版等类型的素材,文章内用于介绍的图片通常并不包含在对应可供下载素材包内。这些相关商业图片需另外购买,且本站不负责(也没有办法)找到出处。 同样地一些字体文件也是这种情况,但部分素材会在素材包内有一份字体下载链接清单