I have a checkbox and when that specific checkbox is checked it shows some text above:
$('#pck-94').click(function() {
$('#pico-info').toggle(this.checked);
});
this wil toggle the text which works and than I wanted to set a scrollspy which scrolls to the text which appears when checkbox is checked here is the html:
<span id="pico-info">(het verjaardagsfeestje Pico Patat is voor kinderen vanaf 4 jaar en maximale lengte 1.30m)</span>
and this is the scrollspy code where the checked is never logged:
if($('input#pck-94').prop('checked')){
console.log('check');
$('body').scrollspy({ target: '#pico-info' });
}
Here a fiddle : LINK
Aucun commentaire:
Enregistrer un commentaire