I am trying to Remove the ‘hover’ function on a clicked checkbox in a group. I can do it on all the checkbox in the group by:
$(document).off('hover', '.myClass .leftSpan');
Is there a way to just remove it from the clicked checkbox?
The ‘hover’ function puts the hover there in the first place, the click is intended to start populating a record set but I want:
$(document).on('hover', '.myClass .leftSpan', function () {
var parID = $(this).prev('input').prop('id')
$('#lblOutput').text(parID);
GetSites(parID, 'false');
GetGroupMetadataFromGroupID(parID);
});
This is the click function:
$(document).on('click', '.myClass .leftSpan', function () {
var parID = $(this).prev('input').prop('id')
$('#lblOutput').text(parID);
GetSites(parID, 'false');
GetGroupMetadataFromGroupID(parID);
$(document).off('hover', parID);
});
But it does not work. I will need to do it to any that are clicked. This could be from just one to all being clicked.
Any ideas anyone?
Simple solution really. I did not find a satisfactory way of removing the hover attribute so I reconfigured the code testing if the checkbox was checked and if it was, miss out the code that calls the list of places related to the checkbox.