2012-12-27 22 views
0

當在正常視圖中使用選擇100%時,網格會定期運行,但如果將大小更改爲較小或縮放,則選擇無法正常工作。在另一方面,該選項檢查工作完全在http://jsfiddle.net/mutesex/czxgg/2/jquery ui可選擇丟失區域縮放動畫

$("#slider").slider({ 
    value: 1, 
    min: 0.1, 
    max: 2, 
    step: 0.1, 
    slide: function (event, ui) { 
    $("#amount").html("" + parseInt((ui.value) * 100) + "%"); 
    $('#<%= GridView1.ClientID%>').animate({ zoom: ui.value }, 1); 
     //selectable___(); 
    } 
}); 

$("#amount").html("100%"); 

function selectable___() { 
    $(document).ready(function() { 
    $("#<%= GridView1.ClientID%>").selectable({ 
    filter: "td[free='yes']", 

    stop: function() { 
    var result = $("#select-result").empty(); 
    $(".ui-selected", this).each(function() { 
     var dia__ = $(this).attr("infodia"); 
     if (!ExisteItem(dia__)) { 
     result.append(" #" + dia__); 
     diasSeleccion.push({ infodia: dia__ }); 
     } 
    }); 
    }, 
    unselected: function (event, ui) { var e = $(ui.unselected); removeItem(e.attr("infodia")); }, 
    unselecting: function (event, ui) { var e = $(ui.unselecting); removeItem(e.attr("infodia")); } 
    }); 
    }); 
}; 
+1

沒有明顯的問題在這裏(使用Chrome最新)。 「選擇」是什麼意思? – Blazemonger

+0

我喜歡Chrome。 –

+0

當我應用zoom + - ,100%完美時出現問題 – mutesex

回答

0

不要使用任何縮放視圖

例如,可選部件忽略它。而是在滑塊更改上設置高度和寬度。

從以下在CSS的寬度和高度刪除!important

.cell 
    { 
     ... 
     width: 200px; 
     ... 
    } 
    .cellcalday 
    { 
     ... 
     height: 100px; 
     ... 
    } 
    .cellcalfds 
    { 
     ... 
     height: 100px; 
     ... 
    } 

改變你這樣的腳本

  $("#slider").slider({ 
      value: 1, 
      min: 0.1, 
      max: 2, 
      step: 0.1, 
      slide: function (event, ui) { 

       $("#amount").html("" + parseInt((ui.value) * 100) + "%"); 
       //$('#ctl00_container_GridView1').animate({ zoom: ui.value }, 1); 
       $("table#ctl00_container_GridView1 tr td.cell").css('width', Math.round(200 * ui.value)); 
       $("table#ctl00_container_GridView1 tr th.cell").css('width', Math.round(200 * ui.value)); 
       $("table#ctl00_container_GridView1 tr td.cellcalday").css('height', Math.round(100 * ui.value)); 
       $("table#ctl00_container_GridView1 tr td.cellcalfds").css('height', Math.round(100 * ui.value)); 

      } 
     }); 

的jsfiddle這裏:http://jsfiddle.net/Ten4u/

+0

太棒了,你送給我的工作希望能回到某天的援助:) – mutesex

+0

我很高興我可以幫助:) – Ertug