- 浏览: 260806 次
- 性别:
- 来自: 北京
最新评论
-
haixin3036:
jQuery是一套跨浏览器的JavaScript库,简化HTM ...
jquery sizzle 选择器浅析 -
panshunchang:
非常感谢分享,正找这东西呢。
基于jQuery的QQ表情插件 -
yuur369:
不错。。。
移动端webapp开发必备知识
解决了横向拖动产生错位的问题,原因是拖动时会给ul添加一个class=hFinderCategoryFilePlaceholder的li,需要把它指定为float并添加宽高,另外拖动完成要去掉hFinderCategoryFileSelected这个class
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta http-equiv='content-language' content='en-us' />
<title></title>
<script src="js/jquery1.7.js"></script>
<script type='text/javascript' src='js/jquery-ui.js'></script>
<script type='text/javascript' src='js/Example 11-3.js'></script>
<link type='text/css' href='style/Example 11-3.css' rel='stylesheet' />
</head>
<body>
<div id='hFinderCategoryFileWrapper'>
<ul id='hFinderCategoryFiles'>
<li class="hFinderCategoryFile" title="第一个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="#"> 第一个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第二个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/php/Polymorphism.html"> 第二个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第三个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/php/Backup%20Script.html"> 第三个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第四个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/web/html5_doctype.html"> 第四个 </a> </div>
</li>
<li class="hFinderCategoryFile" title=" 第五个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/web/ie8_beta2.html"> 第五个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第六个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="#"> 第六个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第七个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/php/Polymorphism.html"> 第七个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第八个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/php/Backup%20Script.html"> 第八个 </a> </div>
</li>
<li class="hFinderCategoryFile" title="第九个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/web/html5_doctype.html"> 第九个 </a> </div>
</li>
<li class="hFinderCategoryFile" title=" 第十个">
<div class="hFinderCategoryFileIcon"></div>
<div class="hFinderCategoryFilePath"> <a href="/Blog/web/ie8_beta2.html"> 第十个 </a> </div>
</li>
</ul>
<!--<ul id='hFinderOtherCategoryFiles'>
</ul>-->
</div>
</body>
</html>
js代码
$(document).ready(
function() {
var $selectedFile;
$('li.hFinderCategoryFile').mousedown(
function() {
if ($selectedFile && $selectedFile.length) {
$selectedFile.removeClass('hFinderCategoryFileSelected');
}
$selectedFile = $(this);
$selectedFile.addClass('hFinderCategoryFileSelected');
}
);
var saveUpdate = function(e, ui) {
var $data = $(this).sortable(
'serialize', {
attribute: 'title',
expression: /^(.*)$/,
key: 'list[]'
}
);
$(".hFinderCategoryFile").removeClass("hFinderCategoryFileSelected");
alert($data);
// Here you could go on to make an AJAX request
// to save the sorted data on the server, which
// might look like this:
//
// $.get('/path/to/server/file.php', $data);
};
$('ul#hFinderCategoryFiles').sortable({
connectWith : [
'ul#hFinderOtherCategoryFiles'
],
placeholder: 'hFinderCategoryFilePlaceholder',
opacity: 0.8,
cursor: 'move',
update: saveUpdate
});
$('ul#hFinderOtherCategoryFiles').sortable({
connectWith : [
'ul#hFinderCategoryFiles'
],
placeholder: 'hFinderCategoryFilePlaceholder',
opacity: 0.8,
cursor: 'move',
update: saveUpdate
});
}
);
css代码:
html,
body {
width: 100%;
height: 100%;
}
body {
font: normal 12px "Lucida Grande", Arial, sans-serif;
background: rgb(189, 189, 189);
color: rgb(50, 50, 50);
margin: 0;
padding: 0;
}
ul#hFinderCategoryFiles,
ul#hFinderOtherCategoryFiles {
width: 700px;
border-bottom: 1px solid rgb(64, 64, 64);
border-right: 1px solid rgb(64, 64, 64);
background: #fff;
list-style: none;
margin:0 auto;
padding: 0;
}
li.hFinderCategoryFile {
float: left;
padding: 5px 5px 10px 5px;
min-height: 48px;
width: 120px;
}
li.hFinderCategoryFile h5 {
font: normal 12px "Lucida Grande", Arial, sans-serif;
margin: 0;
}
div.hFinderCategoryFileIcon {
float: left;
width: 48px;
height: 48px;
background:url(../images/Safari%20Document.png)no-repeat;
}
h5.hFinderCategoryFileTitle,
div.hFinderCategoryFilePath {
padding-left: 55px;
}
li.hFinderCategoryFileSelected {
background: rgb(24, 67, 243);
color: white;
}
li.hFinderCategoryFileSelected a {
color: lightblue;
}
.hFinderCategoryFilePlaceholder {
float:left;
background: rgb(230, 230, 230);
height: 58px; width: 135px;
}
- demo.rar (428.1 KB)
- 下载次数: 97
发表评论
-
CSS团队协作开发方式的思考
2014-05-29 10:59 765有效的团队协作开发, ... -
Javascript类定义语法,私有成员、受保护成员、静态成员等
2014-05-29 10:59 728JS只是一门支持面向对象编程的语言,通过OO可以让我们的 ... -
Javascript 继承模式
2014-05-29 10:59 725在面向对象的JavaScript开发中使用继承可以提高代码 ... -
用JavaScript实现自己的DOM选择器
2014-05-28 14:27 687解释器模式(Interpreter):定义一种语法格式,通过 ... -
Javsript代码的注释和模块定义
2014-05-28 14:21 840可以这样定义模块: (function(ns, re ... -
在JavaScript中应用单例模式管理命名空间
2014-05-28 10:56 803单例模式确保一个类在整个应用程序中只有一个是实例对象,在J ... -
移动WEB开发中媒体查询里的width, device-width, resolution
2014-05-28 10:14 1010/*1、width: viewport的宽度,css像素,三星 ... -
前端性能优化
2014-05-27 15:16 8861. 请减少HTTP请求 基本原理: ... -
jquery sizzle 选择器浅析
2014-05-26 14:23 1215看了jquery的源码,jquery用的选择器的引擎是siz ... -
jQuery 1.8,1.9和2.0分别带来的新特性
2014-05-26 14:17 1337jQuery 1.8 可定制 在jQuery ... -
jquery点击div之外的地方div本身消失
2014-05-15 12:22 883<!DOCTYPE html PUBLIC " ... -
jquery-migrate: 迁移旧的jQuery代码至jQuery1.9以上的版本
2014-05-14 16:31 657这个插件可以用来检测和恢复在jQuery1.9版本中已删除或 ... -
移动WEB在线开发工具 – Codiqa
2014-05-12 15:43 643Codiqa,https://codiqa.com 简单试用 ... -
一种比CSS-Sprite更加方便在网页中嵌入大量图标的方法
2014-05-12 15:34 590这种思路是在一个国外的网站上发现的,设计者在网站中使用了很多 ... -
Google Developers的ResetCSS
2014-05-12 10:32 602@charset "utf-8"; ht ... -
Android手机版浏览器DIV滚动条失效解决方案
2014-05-08 11:09 1218除了BODY和HTML的滚动条,在触屏下几乎所有浏览器都不支 ... -
解耦HTML、CSS和JavaScript
2014-02-14 11:32 628当前在互联网上, ... -
设置双核浏览器的浏览模式
2014-01-20 15:44 665如果访问的页面中有 CSS3 代码,双核浏览器会自动切换到 ... -
使用console.table()调试javascript
2014-01-20 15:42 613或许你已经习惯了console.log()来调试js,非常好 ... -
iOS下无法正常渲染按钮的问题
2014-01-20 15:40 646最近做移动端的页面,碰到了一个问题,就是css无法定义按钮样 ...
相关推荐
jqueryUI拖拽排序插件,单独的插件,可以独立使用!不必引入整个jqueryUi框架就可使用
这是一款使用jquery ui和css3制作的可以拖拽排序的时间行程表插件。这个拖拽排序插件界面简洁,使用方便,值得推荐。
基于jquery ui的Ajax排序功能实现鼠标拖动排序并获得排列顺序.zip
本文主要是通过具体实例分析jQueryUI里拖拽排序问题,十分的实用,这里推荐给小伙伴们。
JQuery实现的拖动排序功能,比JQuery.UI里的类库小很多。有拖放事件回调函数接口。
jQuery ui drag插件实现浮动div拖动排列布局代码,jQuery实现拖动布局并将排序结果保存到数据库
jQuery ui定位层带删除按钮拖动布局排序代码
Jquery实现拖动Div排序效果演示代码下载,可以实现拖动排序图片,表格内容顺序等功能,想看在线演示效果的请前往:http://www.ui3g.com/code/uicode-441.html
最新官方jQuery UI插件 主流特效Demo,绝不含糊。 好东西不需要过多的言辞修饰,下了就知道! 所有效果说明: 基本的鼠标互动: 拖拽(drag and dropping)、排序(sorting)、选择(selecting)、缩放(resizing) 各种...
经过修改,适合bootstrap table拖动排序的jQuery-UI sortable
jQuery可水平垂直自由拖拽代码是一款基于drag.js插件实现的支持水平拖拽,垂直拖拽,自由拖拽等不同特效。
jquery +jquery.tablesorter+jquery.tablednd_0_5实现table表格可按行拖拽,按列排序,并可以保存排序后的结果
通过鼠标拖动来改变div的顺序,来实现指标的排序。使用了Jquery,jquery-ui.js,sortable,自己原创,效果很绚。 配合ThinkPHP可以实现把数据入库,由于使用的是ubuntu, 文件编码格式都是utf-8.
交互部件是一些与鼠标交互相关的内容,包括缩放(Resizable) , 拖动(Draggable) , 放置(Droppable) , 选择(Selectable) , 排序(Sortable)等。 小部件(Widgets) 主要是一些界面的扩展,包括折叠面板...
下面小编就为大家带来一篇通过jquery-ui中的sortable来实现拖拽排序的简单实例。小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
jqueryUI sortable 可以用来进行页面拖拽布局,然而有一个小问题就是拖拽后如何保存状态。 工作中遇到了这个情况,遍把这个问题记了下来,具体思路是: 利用拖拽stop后利用 var arr = $( “.sortable” ).sortable...
从2008年到2014年使用Web应用程序的大多数UI开发人员肯定使用或至少搜索了实现拖放支持的库。 在那个时期内所有可用的库中, 无疑是最好的选择之一。 多年后,大多数Web应用程序都与框架或渲染库(如Angular,Vue和...