开发者

jQuery UI drag and drop problems on IE9

开发者 https://www.devze.com 2023-03-31 04:38 出处:网络
My question is:I does not work drag-an-drop feature of jQuery UI on IE9.What should I do? Here is my code:

My question is:I does not work drag-an-drop feature of jQuery UI on IE9.What should I do?

Here is my code:

 <script type="text/javascript" src="js/jquery-1.3.2-vsdoc.js" ></script>
 <script type="text/javascript" src="js/jquery.json-2.2.min.js" ></script>
 <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js" ></script>
 <script type="text/javascript" >
 $(function() {
    $(".dragbox")
 .each(function() {
 $(this).hover(function() {
     $(this).find("h2").addClass("collapse");
 }, function() {
     $(this).find("h2").removeClass("collapse");
 })
 .find("h2").hover(function() {
  $(this).find(".configure").css("visibility", "visible");
 }, function() {
  $(this).find(".configure").css("visibility", "hidden");
 })
 .click(function() {
  $(this).siblings(".dragbox-content").toggle();
  updateWidgetData();
 })
 .end()
 .find(".configure").css("visibility", "hidden");
 });
    $(".column").sortable({
        connectWith: ".column",
        handle: "h2",
        cursor: "move",
        placeholder: "placeholder",
        forcePlaceholderSize: true,
        opacity: 0.4,
        start: function(event, ui) {
            //Firefox, Safari/Chrome fire click event after drag is complete, fix for that
            if ($.browser.mozilla || $.browser.safari)
                $(ui.item).find(".dragbox-content").toggle();
        },
        stop: function(event, ui) {
            ui.item.css({ "top": "0", "left": "0" }); //Opera fix
            if (!$.browser.mozilla && !$.browser.safari)
                updateWidgetData();
        }
    })
  .disableSelection();
  });
  function updateWidgetData() {
    var items = [];
    $(".column").each(function() {
        var columnId = $(this).attr("id");
        $(".dragbox", this).each(function(i) {
            var collapsed = 0;
            if ($(this).find(".dragbox-content").css("display") == "none")
                collapsed = 1;
            var item = {
                id: $(this).attr("id"),
                collapsed: collapsed,
                order: i,
                column: columnId
            };
            items.push(item);
        });
    });
    var sortorder = { items: items };
    $.ajax({
        type: "POST",
        url: "not.aspx/siralamakaydet",
        data: "{list:'开发者_C百科" + $.toJSON(sortorder) + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        error: function() {
            alert("hata");
        },
        success: function(msg) {

            alert(" Sıralama yapıldı...");
        }
    });
    //Pass sortorder variable to server using ajax to save state

    //    $.post('updatePanels.php', 'data=' + $.toJSON(sortorder), function(response) {
    //        if (response == "success")
    //            $("#console").html('<div class="success">Saved</div>').hide().fadeIn(1000);
    //        setTimeout(function() {
    //            $('#console').fadeOut(1000);
    //        }, 2000);
    //    });
  }
  </script>


I think it's your JQuery and JQuery UI version. Check out this related question: Jquery drag drop bug in IE9

works for that guy in: jquery 1.6.2 & jquery ui 1.8.14

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号