惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - herobeast

hadoop 2.7.1 高可用安装部署 Redis篇 MySql篇 Tomcat篇 JDK篇 web一次下载多个附件 Implementing a Custom Security Manager(翻译) 腾达路由器设置 正则表达式 OSGi规范 OSGi bundle 与 fragment OSGi bundle之间互相通信的方法 Apache CXF 分布式OSGi部署HelloWorld 五米测试 Spring.DM web 开发环境搭建 - herobeast Spring.DM版HelloWorld 腾讯资深产品经理谈敏捷开发于游戏 js矢量图类库:Raphaël—JavaScript Library 关于生成id的问题
jQuery Resizable笔记
herobeast · 2012-05-09 · via 博客园 - herobeast
JQ UI集中有个对窗口大小调整的控件:Resizable,可以按照一定条件拖拉调整窗口尺寸。包括限制最大/最小尺寸,等比调整,栅格调整,同比窗口。现在来看看如何对其进行调用:

JQ 的UI包里面的示例中有个叫splitpane的实例,演示的就是如何使用这个UI。

$('div ').resizable({
    alsoResize: false, //2个窗口同比缩放,例如: ‘#id’
    animate: false, //设置动画效果
    animateDuration: “slow”, //动画频率
    animateEasing: “swing”,
    aspectRatio: false,  //设置缩放比例,本窗口比例
    autoHide: false,
    cancel: “:input,option”,
    containment: false, //以父系元素高宽为缩放范围,这个尺寸为父系元素宽(高)-margin值
    delay: 0,  //延时缩放效果 移动多少毫秒后开始缩放  单位毫秒
    distance: 1, //延时缩放效果,移动多少px开始缩放  单位px
    ghost: false,  //复制显示缩放效果
    grid: false, //栅格缩放,单位px
    handles: “e,s,se”,//横向拖动,或竖向拖动
    helper: false, 
    maxHeight: null, //最大高度
    maxWidth: null, //最大宽度
    minHeight: 10, //最小高度
    minWidth: 10, //最小宽度
     zIndex: 1000
});

可以从中看到JQ的Resizable这个UI可配置的参数还是很多的,可以根据实际需求进行调整,但并非所有的参数都是必须的。
值得说明的是:在CSS里面有二个样式比较重要,缺少这二个IE6下就无法移动。

.ui-resizable-e {
    width: 10px; height: 475px;
    background:#e1e7f2 url(../images/splitpane_handle-ew.gif) no-repeat scroll 75% 50% !important;
    cursor:col-resize !important;
    border-left: #bbb 1px solid;
    padding: 3px;
}
.ui-resizable-n {
    height: 10px;
    background:#e1e7f2 url(../images/splitpane_handle-sn.gif) no-repeat scroll 50% 55% !important;
    border-top: #bbb 1px solid;
    padding: 3px;
}