开发者

changer helper id

开发者 https://www.devze.com 2023-02-17 23:39 出处:网络
i want to change helper id it doesent work $(\'.column1\').draggable({ containment: \'#sort\' , helper:\'clone\',

i want to change helper id it doesent work

$('.column1').draggable({
containment: '#sort' , 
helper:'clone',
co开发者_运维技巧nnectToSortable:'#sort',
start: function(event,ui) {
            i=counts[ 0 ]++;
            document.getElementById('wid').value=i;
            updateCounterStatus( $start_counter, counts[ 0 ] );
            ui.helper.attr("id","colum2");


        }


Looking at the jQuery UI documentation, that should work...how do you know it is not working? All I can suggest is to try changing ui.helper.attr("id", "colum2"); to $(ui.helper).attr("id", "colum2");.


Helper ID can only be either 'original' or 'clone'. If you change it, it will stop working.

What exactly are you trying to accomplish?


A jQuery draggable helper has the class 'ui-draggable-dragging'. Try this:

start: function(event,ui) {
    i=counts[ 0 ]++;
    document.getElementById('wid').value=i;
    updateCounterStatus( $start_counter, counts[ 0 ] );
    $('.ui-draggable-dragging').attr("id","colum2");
}


well i made it thanks for your answer

solution:

$('#colum').draggable({

helper:'clone',
connectToSortable:'#sort',
start: function(event,ui) {
            k=counts[ 0 ]++;
            document.getElementById('wid').value=i;
            updateCounterStatus( $start_counter, counts[ 0 ] );
             $(this).attr("id","colum"+k);



        }
0

精彩评论

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