javascript - jQuery ui Selectable() need ctrl+click to select but I want draggable+ multi click to select -


i using selectable() of jquery-ui, working perfect me while clicking ctrl+click , dragging also.

but want change ctrl+click single click, , click select squares row.

here example, single click select squares. need this. http://www.social-contests.com/check-image/

thanks 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);          }      });

it wasn't easy :) think found solution. had dig source code, , found can simulate press ctrlkey. solution easy:

event.originalevent.ctrlkey = true; 

note if set true this:

event.ctrlkey = true; 

it not give effect.

http://jsfiddle.net/awguykk4/


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -