Jquery ui Selectable() need ctrl+click to select but I want draggable+ multi click to selct

I am using selectable() of jquiry-ui, It working perfect for me while clicking ctrl+click and dragging also.

But I want to change the Ctrl+click to only single click, and this click also select my squares row. Here is an example, where single click select the squares. I need this. http://www.social-contests.com/check-image/

Thanks you so much...

$cover.selectable({ stop: function () { var total = $('.square').size(); var selected = $('.square.ui-selected').size(); var percent = Math.round(selected * 100 / total); var alert = $('#score').find('.alert').addClass('hide'); if (percent <= 20) { $('#score').find('.alert-success').removeClass('hide'); } else { $('#score').find('.alert-error').removeClass('hide'); } $("#score").find('span.score-value').html(percent); } });

-------------Problems Reply------------

It wasn't easy :) But I think I found solution. I had to dig into the source code, and I found that we can simulate that we press ctrlKey. The solution actually is very easy:

event.originalEvent.ctrlKey = true;

Note that if you set true like this:

event.ctrlKey = true;

it will not give effect.


Category:javascript Views:1 Time:2018-09-13

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.207 (s). 11 q(s)