Hi
I upgraded from phpMaker2017 to 2020.In phpMaker 2017 I had following code in Client Scrips - Global - pages with header/footer - Client ScriptjQuery(document).ready(function () {
jQuery(‘a.ewLightbox’).colorbox({
maxWidth:‘95%’,
maxHeight:‘95%’,
opacity:0.5,
rel:‘ewLightbox’
});});with this option it was possible to klick an image, an then I could continue to the next image with the arrows from the keyboard.
In 2020 this code does not work anymore.I found this script in the forum// Make ColorBox responsive
jQuery.colorbox.settings.maxWidth = ‘95%’;
jQuery.colorbox.settings.maxHeight = ‘95%’;// ColorBox resize function
var resizeTimer;
function resizeColorBox()
{
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
if (jQuery(‘#cboxOverlay’).is(‘:visible’)) {
jQuery.colorbox.load(true);
}
}, 300);
}// Resize ColorBox when resizing window or changing mobile device orientation
jQuery(window).resize(resizeColorBox);window.addEventListener(“orientationchange”, resizeColorBox, false);This option works fine, but there is no possibility to go to the next image by keyboard.I have the links to the Website but it seems that it is not allowed to post them……Any ideas ?
Yves
Thank you for your answer, but I cannot bring this post in relation with my problem. I searched in Web and it seems that I need something like
jQuery.colorbox.settings.arrowKey = true ;
to activate the arrows. New code above is working, just with now arrows to navigate.
You may update ew.lightboxSettings, e.g. in client side global codeew.lightboxSettings.arrowKey = true;
Sorry, but still not working :-(In global Scripts - Global - Pages with /header footer - Global Code I inserted follwowing code:
ew.lightboxSettings.arrowKey = true;In global Scripts - Global - Pages with /header footer - Client Script I inserted the code posted above (and the code works, the size of the box is 95% and it reacts responsive.
Just the arrows to navigate still are missing.
Solution
This is because images are now shown for the row only. To show all images in the page, in the Row_Rendered server event, add:$this->Field->LinkAttrs[“data-rel”] = “