今天给大家分享一款基于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. jquery.validate1.9.0前台验证使用

    一.利用jquery.form插件提交表单方法使用jquery.validate插件 现象:当提交表单时,即使前台未验证通过,也照常提交表单. 解决办法: $('#myForm').submit(fu ...

  2. Node.js:Express 框架

    Express 是一个简洁而灵活的 node.js Web应用框架, 提供了一系列强大特性帮助你创建各种 Web 应用,和丰富的 HTTP 工具.使用 Express 可以快速地搭建一个完整功能的网站 ...

  3. System.Drawing.Color的颜色对照表

    经常使用System.Drawing.Color, 本篇介绍一下颜色与名称及RGB值的对应关系. 1. 颜色与名称的对照表(点击下图放大看): 2. 颜色与RGB值对照表: Color.AliceBl ...

  4. 转: SVN和Git的一些用法总结

    转:http://www.codelast.com/?p=5719 转载请注明出处:http://www.codelast.com/ 以下都是比较基础的操作,高手们请绕道,不必浪费时间来看了. (A) ...

  5. HashMap的工作原理--重点----数据结构示意图的理解

    转载:http://blog.csdn.net/qq_27093465/article/details/52209814 HashMap的工作原理是近年来常见的Java面试题.几乎每个Java程序员都 ...

  6. Linux shell 提取文件名和目录名

    ${}用于字符串的读取,提取和替换功能,可以使用${} 提取字符串 1.提取文件名 [root@localhost log]# var=/dir1/dir2/file.txt [root@localh ...

  7. APNS 生成证书 p12 或者 PEM

    .net环境下须要p12文件,下面是生成p12过程 1.$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem ...

  8. unity3d 版本控制场景合并。

    Editor→ProjectSettings→Editor Version Control Mode 设置为 "Visible Meta Files" Asset Serializ ...

  9. Python 换行符

    raw字符串与多行字符串如果一个字符串包含很多需要转义的字符,对每一个字符都进行转义会很麻烦.为了避免这种情况,我们可以在字符串前面加个前缀 r ,表示这是一个 raw 字符串,里面的字符就不需要转义 ...

  10. 【LeetCode】81. Search in Rotated Sorted Array II (2 solutions)

    Search in Rotated Sorted Array II Follow up for "Search in Rotated Sorted Array":What if d ...