基于jQuery页面窗口拖动预览效果
今天给大家分享一款基于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>
<link rel="stylesheet" href="minimap.min.css" /><br>
<script src="jquery.js"></script><br>
<script src="minimap.min.js"></script><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 : "right",<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 & 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页面窗口拖动预览效果的更多相关文章
- Jquery图片上传预览效果
uploadPreview.js jQuery.fn.extend({ uploadPreview: function (opts) { var _self = this, _this = $(thi ...
- jquery实现上传图片本地预览效果
html: <img id="pic" src="" ><input id="upload" name="fil ...
- ThinkPHP5与JQuery实现图片上传和预览效果
内容正文 这篇文章主要为大家详细介绍了thinkphp上传图片功能,和jquery预览图片效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 先上效果图: html和js代码如下: <!DO ...
- jquery实现上传图片及图片大小验证、图片预览效果代码
jquery实现上传图片及图片大小验证.图片预览效果代码 jquery实现上传图片及图片大小验证.图片预览效果代码 上传图片验证 */ function submit_upload_picture() ...
- jQuery Lightbox图片放大预览
简介:jQuery Lightbox图片放大预览代码是一款可以在用户点击页面中的小图片时,将该图片的高清版本以Lightbox的方式放大显示在页面的中间,提高用户的体验度. 效果展示 http://h ...
- 基于html5页面滚动背景图片动画效果
基于html5页面滚动背景图片动画效果是一款带索引按钮的页面滚动动画特效代码.效果图如下: 在线预览 源码下载 实现的代码. html代码: <div id="fullpage&q ...
- 基于jquery tool实现的windows桌面效果
今天给大家分享一款基于jquery tool实现的windows桌面效果.这款实例适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: ...
- 实现QQ空间图片预览效果
今天项目遇到需求 要求 实现图片预览效果 . 类似于扣扣空间那种,本人也到网上找过 代码量太大了 ,类多到处是注释看的有点恶心 .然后自己写了一个图片预览的效果,其实很简单的 . 首先我们来分析 ...
- JavaScript实现图片裁剪预览效果~(第一个小玩具)
感觉开始学习的前一个月真的太不珍惜慕课网的资源了 上面蛮多小玩意真的蛮适合我这样刚入门JavaScript的同学加深使用理解 大概收藏了百来门或大或小的课程 有一个感觉就是学这个真的比光是看书看概 ...
随机推荐
- HTTPS服务器配置
一.SSL证书申请 1.确认需要申请证书的域名 2.生成私钥和csr文件 在linux机器上执行以下命令生成私钥 #openssl genrsa -out server.key 2048 在linux ...
- Android -- 压缩与解压文件
我在做一个项目中,工程文件中有一个功能需要很多图片,图片与app一起打包下来的话有30+M,那么我们就考虑另外下载压缩包,我们将图片取出,工程就只有4+M了,哈哈哈哈,呵呵,真恐怖.那么这样就涉及到另 ...
- [转]Clean Code Principles: Be a Better Programmer
原文:https://www.webcodegeeks.com/web-development/clean-code-principles-better-programmer/ ----------- ...
- (C++)C++类继承中的构造函数和析构函数
思想: 在C++的类继承中, 建立对象时,首先调用基类的构造函数,然后在调用下一个派生类的构造函数,依次类推: 析构对象时,其顺序正好与构造相反: 例子: #include <iostream& ...
- C++ 之 基础回顾(一)
1 exe 程序
- centos安装问题集合
1.版本选择可能直接打开www.centos.org打不开,但是可以打开http://wiki.centos.org/zh/Download,直接找到centos下载列表, (1)i386:支持32位 ...
- 简单测试Demo:如何用Java压缩文件夹和文件
一.直接贴出测试代码 package com.jason.zip; import java.io.File; import java.io.FileInputStream; import java.i ...
- 算法笔记_039:杨辉三角形(Java)
目录 1 问题描述 2 解决方案 1 问题描述 问题描述 杨辉三角形又称Pascal三角形,它的第i+1行是(a+b)i的展开式的系数. 它的一个重要性质是:三角形中的每个数字等于它两肩上的数字相加. ...
- Java网络编程-HTTP协议
HTTP协议的定义 这篇文章暂时不研究HTTP底层的TCP/IP的握手和挥手过程,只从表面的交互流程分析HTTP协议. HTTP英文全称是Hypertext Transfer Protpcol,也就是 ...
- Simple drag and drop
In computer graphical user interfaces, drag-and-drop is the action of (or support for the action of) ...