Coder Social home page Coder Social logo

ddsort's Introduction

DDSort

一个轻简的jQuery拖放排序插件。

● 漂亮的UI展示:

DDSort

● 使用方法:

1、假设Html结构如下:

<div id="wrap">
	<ul>
		<li>...</li>
		<li>...</li>
		...
	</ul>
</div>

2、依次引入jquery.js和ddsort.js,然后使用DDSort API实现如图拖放排序效果:

$( '#wrap' ).DDSort({
	target: 'li',			//示例而用,默认即'li'
	floatStyle: {			//示例二用,默认有一定的样式
		'border': '1px solid #ccc',
		'background-color': '#fff'
	}
});

3、如果拖放列表带有滚动条,那么$( '#wrap' )要是这个滚动条的元素。

● 详细API

DDSort方法接受一个JSON对象类型的参数,以下是对这个参数的描述。

参数列表 类型 描述
target string 可选,插件内部使用的是jQuery的on方法绑定的事件,此参数就是on方法上的选择器字符串,默认'li'
cloneStyle object 可选,设置占位符元素的样式
floatStyle object 可选,设置拖动元素的样式
down function 可选,鼠标按下时执行的函数
move function 可选,鼠标移动时执行的函数
up function 可选,鼠标抬起时执行的函数

ddsort's People

Contributors

barrior avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.