今天给大家分享一款基于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. GLSL 在OpenGL中向shader传递信息【转】

    http://blog.csdn.net/hgl868/article/details/7872219 引言 一个OpenGL程序可以用多种方式和shader通信.注意这种通信是单向的,因为shade ...

  2. JavaScript hash

    location.hash -- 返回URL#后面的内容,如果没有#,返回空 hash,中文"哈希" 引用网址:http://www.dreamdu.com/javascript/ ...

  3. Python——管理属性(1)

    管理属性 这里将展开介绍前面提到的[属性拦截]技术.包含下面内容: [1]__getattr__和__setattr__方法.把没有定义的属性获取和全部的属性赋值指向通用的处理器方法 [2]__get ...

  4. Android Api Component---翻译任务和回退栈(Tasks and Back Stack)

    一个应用程序通常包括多个activity.每个activity应当环绕一个指定的用户能够运行的而且能够开启其他activity的动作种类被设计. 比如,一个emali应用程序或许有一个activity ...

  5. Flutter混合工程改造实践

    背景 6月下旬,我们首次尝试用Flutter开发AI拍app.开发的调研准备阶段没有参考业界实践,导致我们踩到一些填不上的坑.在这些坑中,最让我感到棘手的是Flutter和原生页面混合栈管理的问题. ...

  6. Apache 整合 Acitve Directory 達成 one single signon

    原文地址:http://blog.hsdn.net/1266.html 我的公司使用AD進行使用者驗證,因此在使用者操作的便利性考量前提下.如何讓使用者不需要重覆輸入帳號與密碼,而直接抓取使用者已經登 ...

  7. hdu 4494 Teamwork (可行流的最小流)

    去年通话邀请赛的B题,当时居然过的那么少...明明是一道非常裸的可行流最小流麽..仅仅要对每种人分别求一下可行最小流加起来就能够了.建图是对每一个点拆点,容量上下届都设为v[i],然后每一个点间能连边 ...

  8. Servlet/Jsp实现购物车

    (1)用servlet实现简单的购物车系统,项目结构例如以下:(新建web Project项目  仅仅须要AddItemServlet , ListItemServlet.exam403.jsp三个文 ...

  9. Ubuntu14.04安装redis-server

    1.update再install操作: sudo apt-get update sudo apt-get install -y redis-server 如果你已经安装了redis,会提示:redis ...

  10. centos6.5下使用yum完美搭建LNMP环境(php5.6,mysql5.5,nginx1.10)

    准备工作 配置防火墙,开启80端口.3306端口 不用执行这句:rm -rf /etc/sysconfig/iptables 直接进入修改:vi /etc/sysconfig/iptables 添加8 ...