Jquery 拖放在 chrome 和 ie9 中不起作用

标签 jquery jquery-ui jquery-plugins

我正在使用 jquery 的拖放功能。它在 Firefox 中工作正常,但在 chrome 和 ie9 中失败。

以下是我正在使用的 jquery lib 版本:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<script src="http://code.jquery.com/jquery-latest.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-ui-1.8.2.custom.min.js"></script>

这是我的拖放代码:

$(function() {
    $(".item").draggable({
            revert: true
    });
    $("#mail-circle-wraper").droppable({
            tolerance: 'touch',
            over: function() {   

                   $(this).removeClass('out').addClass('over');
            },
            out: function() {           
                $(".item").draggable({
                    revert: false
            });
                    $(this).removeClass('over').addClass('out');
            },
            drop: function() {
                    bootbox.confirm("Add this person to circle ?", function(confirmed) {

                        // do somthing
                    });

                    $(this).removeClass('over').addClass('out');
            }
    });
});

提前致谢:)

最佳答案

尝试将您的 jquery 库更改为以下内容:

https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js

让我知道这是否有效。

关于Jquery 拖放在 chrome 和 ie9 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11797474/

相关文章:

javascript - 为什么带有连字符 (-) 的 id 选择器不适用于 javascript

jQuery 遍历问题

javascript - jQuery 在悬停错误上向上/向下滑动

jquery - 当我们关闭叠加层时,YouTube 视频不会停止

javascript - Laravel AJAX - 记住多个选择的过滤器

javascript - 如何在 Flot 图中显示带有数据点数据的弹出窗口?

javascript - jQuery Mobile 如何检查按钮是否被禁用?

javascript - 将 jQuery UI 可放置元素还原为原始 div

php - 客户端模板

jquery - 禁用第一个和最后一个元素的 keyCode