今天给大家分享一款基于Query页面窗口拖动预览效果。这是一款基于jQuery+HTML5实现的模拟页面窗口显示拖动窗口预览特效。这款实例适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗。

在线预览   源码下载

实现的代码。

html代码:

 <p>
minimap - A jQuery Plugin<br>
A preview of full webpage or its DOM element with flexible positioning and navigation
support</p>
<p>
Demo Page</p>
<p>
Getting Started</p>
<p>
Download the latest code</p>
<p>
Fork this repository or download js/css files from dist directory.</p>
<p>
Including it on your page</p>
<p>
<img src="img/123szf.jpg" alt="" /></p>
<p>
<img src="img/asd123.jpg" alt="" /></p>
<p>
&lt;link rel=&quot;stylesheet&quot; href=&quot;minimap.min.css&quot; /&gt;<br>
&lt;script src=&quot;jquery.js&quot;&gt;&lt;/script&gt;<br>
&lt;script src=&quot;minimap.min.js&quot;&gt;&lt;/script&gt;<br>
Basic Usage</p>
<p>
//Desired dom element<br>
var previewBody = $('body').minimap();<br>
Properties</p>
<p>
heightRatio</p>
<p>
height ratio of the view port. ratio can be in the range [0.0, 1.0). (default: 0.6)<br>
widthRatio</p>
<p>
width ratio of the view port. ratio can be in the range [0.0, 0.5). (default: 0.05)<br>
offsetHeightRatio</p>
<p>
Margin top ratio of the view port. ratio can be in the range (0.0, 0.9]. (default:
0.035)<br>
offsetWidthRatio</p>
<p>
Margin left or right(based on position property) ratio of the view port. ratio can
be in the range (0.0, 0.9]. (default: 0.035)<br>
position</p>
<p>
position of the minimap. Supported positions are:<br>
'right' (default)<br>
'left'<br>
touch</p>
<p>
touch support. (default: true)<br>
smoothScroll</p>
<p>
linear animation support for scrolling. (dafault: true)<br>
smoothScrollDelay</p>
<p>
Smooth scroll delay in milliseconds. (default: 200ms)<br>
Setters</p>
<p>
function setPosition(position)</p>
<p>
Set position property. position can be either 'left' or 'right'<br>
function setHeightRatio(ratio)</p>
<p>
Set heightRatio property.<br>
function setWidthRatio(ratio)</p>
<p>
Set widthRatio property.<br>
function setOffsetHeightRatio(ratio)</p>
<p>
Set offsetHeightRatio property.<br>
function setOffsetWidthRatio(ratio)</p>
<p>
Set offsetWidthRatio property.<br>
function setSmoothScroll(smooth)</p>
<p>
Set smoothScroll property<br>
function setSmoothScrollDelay(duration)</p>
<p>
Set setSmoothScrollDelay property.<br>
Callback</p>
<p>
function onPreviewChange()</p>
<p>
onPreviewChange callback will be triggered for the below cases:<br>
View port is resized.<br>
Calling setter functions.<br>
Other functions</p>
<p>
function show()</p>
<p>
Show preview<br>
function hide()</p>
<p>
Hide preview<br>
function toggle()</p>
<p>
Toggle Preview<br>
Default Settings</p>
<p>
Mini-map with default values</p>
<p>
var previewBody = $('body').minimap(<br>
heightRatio : 0.6,<br>
widthRatio : 0.05,<br>
offsetHeightRatio : 0.035,<br>
offsetWidthRatio : 0.035,<br>
position : &quot;right&quot;,<br>
touch: true,<br>
smoothScroll: true,<br>
smoothScrollDelay: 200,<br>
onPreviewChange: function() {}<br>
});<br>
CSS classes</p>
<p>
Use the below css classes for customization</p>
<p>
.minimap - Mini-map area</p>
<p>
.miniregion - Mini-map view area<br>
Caveats</p>
<p>
Browser's find gives result in both the page &amp; its preview<br>
Async updates to the dom elements after minimap was created may not reflect in the
preview.</p>

js代码:

$(document).ready(function () {

            var previewBody = $('body').minimap({
heightRatio: 0.6,
widthRatio: 0.1,
offsetHeightRatio: 0.035,
offsetWidthRatio: 0.065,
position: "right",
touch: true,
smoothScroll: true,
smoothScrollDelay: 200,
onPreviewChange: function () { }
}); });

via:http://www.w2bc.com/Article/26978

基于jQuery页面窗口拖动预览效果的更多相关文章

  1. Jquery图片上传预览效果

    uploadPreview.js jQuery.fn.extend({ uploadPreview: function (opts) { var _self = this, _this = $(thi ...

  2. jquery实现上传图片本地预览效果

    html: <img id="pic" src="" ><input id="upload" name="fil ...

  3. ThinkPHP5与JQuery实现图片上传和预览效果

    内容正文 这篇文章主要为大家详细介绍了thinkphp上传图片功能,和jquery预览图片效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 先上效果图: html和js代码如下: <!DO ...

  4. jquery实现上传图片及图片大小验证、图片预览效果代码

    jquery实现上传图片及图片大小验证.图片预览效果代码 jquery实现上传图片及图片大小验证.图片预览效果代码 上传图片验证 */ function submit_upload_picture() ...

  5. jQuery Lightbox图片放大预览

    简介:jQuery Lightbox图片放大预览代码是一款可以在用户点击页面中的小图片时,将该图片的高清版本以Lightbox的方式放大显示在页面的中间,提高用户的体验度. 效果展示 http://h ...

  6. 基于html5页面滚动背景图片动画效果

    基于html5页面滚动背景图片动画效果是一款带索引按钮的页面滚动动画特效代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div id="fullpage&q ...

  7. 基于jquery tool实现的windows桌面效果

    今天给大家分享一款基于jquery tool实现的windows桌面效果.这款实例适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: ...

  8. 实现QQ空间图片预览效果

    今天项目遇到需求 要求 实现图片预览效果 .  类似于扣扣空间那种,本人也到网上找过 代码量太大了   ,类多到处是注释看的有点恶心 .然后自己写了一个图片预览的效果,其实很简单的 . 首先我们来分析 ...

  9. JavaScript实现图片裁剪预览效果~(第一个小玩具)

    感觉开始学习的前一个月真的太不珍惜慕课网的资源了  上面蛮多小玩意真的蛮适合我这样刚入门JavaScript的同学加深使用理解 大概收藏了百来门或大或小的课程  有一个感觉就是学这个真的比光是看书看概 ...

随机推荐

  1. easyui datagrid 分页保持checkbox选中状态

    刚开始我一直迷迷糊糊的写了很久,发现其实很简单 先给大家看看我的笨办法 var checkedItems = []; function ischeckItem() { for (var i = 0; ...

  2. 自用封装javascript函数

    (function(){ var JHRZ_IMG_Arr = JHRZ_IMG_Arr || {}; JHRZ_IMG_Arr.loading = ["/static/images/loa ...

  3. (剑指Offer)面试题51:数组中重复的数字

    题目: 在一个长度为n的数组里的所有数字都在0到n-1的范围内. 数组中某些数字是重复的,但不知道有几个数字是重复的.也不知道每个数字重复几次.请找出数组中任意一个重复的数字. 例如,如果输入长度为7 ...

  4. 【Android实战】----基于Retrofit实现多图片/文件、图文上传

    本文代码详见:https://github.com/honghailiang/RetrofitUpLoadImage 一.再次膜拜下Retrofit Retrofit不管从性能还是使用方便性上都非常屌 ...

  5. 区域医疗移动医疗影像解决方案--基于HTML5的PACS--HTML5图像处理【转】

    基于HTML5的PACS--图像伪彩 摘要: 要查看此系统更多的图像处理功能请参考:区域医疗移动医疗影像解决方案--基于HTML5的PACS--HTML5图像处理套用句广告语:哪里不会点哪里,so e ...

  6. Flutter混合栈的管理

    Flutter出现的目的旨在统一Android/IOS两端编程,因此完全基于Flutter开发的App,只需提供一个包含FlutterView的页面,后续页面增加/删除/跳转均在FlutterView ...

  7. windows程序崩溃生成dump文件

    第一种: 通过任务管理器:这种适用在程序挂了(crash)的时候进程还未退出,比如我运行程序,出现了下面的错: 此时打开任务管理器,右击相应进程,点击"Create Dump File“: ...

  8. Linux mkdir 如何递归创建目录?

    mkdir 如何递归创建目录? mkdir –vp 目录1/目录2/目录3   详细介绍: linux mkdir 命令用来创建指定的名称的目录,要求创建目录的用户在当前目录中具有写权限,并且指定的目 ...

  9. Tp框架中模板中if条件如何使用?

  10. Jquery重新学习之二[属性attr(),removeAttr(),prop(),removeProp()]

    1:属性.attr(name|pro|key,val|key,fn)与removeAttr(name) 1.1 .attr(name) 参数name为属性名称 <a id="my_hr ...