- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Combining Scripts!
Hello guys – I would appreciate some help on this as i am by no means a JS expert, but love the reap the benefits of jQuery and such libraries!
I have a plugin installed and running that allows me to hold ‘Shift’ and click to select multiple checkboxes (in sequence).
This is the plugin: http://www.sanisoft.com/blog/2009/07/02/jquery-shiftcheckbox-plugin/
And the Demo: http://www.sanisoft.com/downloads/shiftcheckbox/demo.html
Its a great plugin that works really well – i have NO issues with it.
This is the in-page call:
$(document).ready (
function () {
$('.cbSelect').shiftcheckbox();
});
What i want is to incorporate a piece of script like this:
$('#myDiv').click(function(evt) {
if (evt.target.type !== 'checkbox') {
var $checkbox = $(":checkbox", this);
$checkbox.attr('checked', !$checkbox.attr('checked'));
evt.stopPropagation();
return false;
}
});
…that will allow me to click the surrounding div to select the checkbox inside.
This code ALSO works, but the two don’t combine as i feared they wouldn’t… Any help would be much appreciated!
Cheers guys,
Alex
I think the most likely chance that any1 will be able to answer your question if you send a mail to the people who made the plugin…
It’s a hard problem.
Hi infocentre,
I might be able to assist, by clicking the surround div you would like check or uncheck the checkbox contained within that div, correct? Would the div ever contain more than one checkbox?