Can I use a TYPO3 Mask checkbox field into my javascript code, in fact I have a slider item and I want to add a checkbox for autoplay (on/off) in the backend of TYPO3, then the editor can use it.
swipe: true,
swipeToSlide: true,
adaptiveHeight: true,
touchThreshold: 10,
autoplay: true, <-----------
autoplaySpeed: 3000,
});
In order to pass content element data to JavaScript, I suggest the data-pattern:
Fluid:
<... data-slider-autoplay="{data.tx_mask_autoplay}">
JavaScript:
document.querySelector['[data-slider-autoplay]'].dataset.sliderAutoplay