Skip to content

Instantly share code, notes, and snippets.

@melbourne2991
Created March 7, 2014 00:09
Show Gist options
  • Save melbourne2991/9402480 to your computer and use it in GitHub Desktop.
Save melbourne2991/9402480 to your computer and use it in GitHub Desktop.
$('.full_wrap').mousedown(function(e) {
// get container co ordinates
var tcw= $('.tags_container.stores_only').width(),
tch= $('.tags_container.stores_only').height(),
tct= $('.tags_container.stores_only').offset().top,
tcl= $('.tags_container.stores_only').offset().left;
// calculate selectable zone
var xCoordsMin = tcl,
xCoordsMax = tcl + tcw,
yCoordsMin = tct,
yCoordsMax = tct + tch;
// only trigger if a click occurs outside of the selectable zone,
// clicks that occur within the selectable zone are handled
// by jquery ui.
if(yCoordsMax > e.pageY < yCoordsMin && xCoordsMax > e.pageX < xCoordsMin) {
if(!$(e.toElement).parent().hasClass('ui-selectee')) {
$('.ui-selected').removeClass('ui-selected');
$('.ui-click-select').removeClass('ui-click-select');
$('#drag_multiple_button').hide();
}
} else {
console.log('in');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment