0

I'm messing around with porting an image selection tool into jQuery. I'm having a couple little issues that are annoying me--

First, the sortable placeholder appears to be stuck at the top of the UL-- it doesn't move down to show the proposed new position if the item were dropped.

Second, the click events attached to the buttons don't fire reliably-- sometimes they work fine, other times it takes 2, 3 or 4 clicks before they fire.

I have been reading a ton of tutorials and the jQuery docs, and I believe I've done this properly, but I'm sure there's better ways to handle what I've attempted.

Here's a jsfiddle showing the behaviour. Any help appreciated!

http://jsfiddle.net/Y2tRW/9/

4

1 回答 1

1

测试了第一个问题

  • ie9(如果文档以 ie8 兼容模式加载,则占位符按预期工作)
  • chromium21(在一台电脑上可以工作而在另一台上不行,我很失望)
  • 歌剧11

占位符按预期工作,第二个问题是您需要准确单击 <i> 元素,如果您单击按钮而不是图像,它只会滚动到页面顶部。

这将解决问题,改变

$("#sortable").on("click", "i.icon-pencil", function(e) {

$("#sortable").on("click", "a.btn:has(i.icon-pencil)", function(e) {

编辑:找到它

float:left;所有的 li 元素都有(它在 bootstrap-combined.min.css 中,用于 .span12),但不是突出显示

将它添加到您的小提琴中,它将起作用。

它在家里工作,因为我总是将兼容性设置为 IE8,现在我摆脱了那个设置,它不起作用。顺便说一下ie8不适float:left用于display:list-item;

于 2012-10-09T20:33:37.763 回答