jQuery的有&QUOT排序插件;滑动效果"? [英] jquery sortable plugin with "sliding effect"?

查看:168
本文介绍了jQuery的有&QUOT排序插件;滑动效果"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQueryUI的得到了一个不错的插件,可排序: http://jqueryui.com/demos/sortable/
我很高兴与插件,但我唯一缺少的一件事。这是反而让改变立场流行/跳转到新的位置的元素,我希望他们滑到新的位置来代替。通过换句话说,让它多一点顺畅。

jQueryUI has got a nice plugin, Sortable: http://jqueryui.com/demos/sortable/ I'm very pleased with that plugin but I'm only missing one thing. And that is instead of let the elements that changes position pop/jump to its new position, I'd like them to "slide" to that new position instead. By other words, make it a bit more smoother.

我搜索过三天净现在没有带发现了一个插件,这是否(!?!?)。我的意思是来吧,必须至少有一个吧?

I've searched the 'net for three days now and havn't found one plugin that does that (!?!??). I mean come on, there must be one, right?

我也试图修改我自己的codeA一下,我得到它的排序工作(通过克隆元素,克隆滑动到新的位置,然后删除该克隆。同时我中号隐藏原始元素和删除克隆后,取消隐藏它)。但它并不能很好地工作,而且我认为必须有一个更好的在某处!

I've also tried to modify the code a bit on my own, and I got it to work sort of (by cloning the element, slide the clone to the new position, then delete the clone. meanwhile I'm hiding the original element and unhide it after deleting the clone). But it doesn't work very well, and I thought there must be a better one out there somewhere!

所以,我真的乞求帮助。要么修改帮助,或者如果你见过一个插件,这样做,请(

So I'm really begging for help. Either modifying help, or if you've seen a plugin that does this, please (:

推荐答案

如果你看一下排序演示与placehoder 并使用以下code初始化排序,你会看到占位符滑动动作

if you look at the sortable demo with placehoder and use the following code to initialize the sortable you'll see a sliding action in the placeholder

$(function() {
  $("#sortable").sortable({
    placeholder: 'ui-state-highlight',
    start: function (e,ui){        // new lines to
      $(ui.placeholder).slideUp(); // remove popping
    },                             // effect on start
    change: function (e,ui){
      $(ui.placeholder).hide().slideDown();
    }
  });
  $("#sortable").disableSelection();
});

您可以通过使用CSS属性知名度类UI状态高亮更改为任何你想要的风格,你可以把它无形的,它设置为隐藏

you can change the class ui-state-highlight to anything you want to style it, you can make it invisible by using css-property visibility and set it to hidden

我取得了 jsbin.com 基本的例子,所以你可以看到它像什么

i made the basic example in jsbin.com so you can see what its like

编辑:例涉及您的删除弹出效果的启动的分类

example with the popping-effect removed when you start sorting

这篇关于jQuery的有&QUOT排序插件;滑动效果"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆