How to make changes to Fancybox javascript values?
-
Hi guys.
Before the recent upgrades, I used to modify my Fancybox attributes by changing class-fire-ressources.php so that the Fancybox script read:
<script type="text/javascript"> jQuery(document).ready(function( $) { // Fancybox $("a.grouped_elements").fancybox({ 'transitionIn' : 'elastic' , 'transitionOut' : 'elastic' , 'speedIn' : 200, 'speedOut' : 200, 'overlayShow' : true, 'hideOnOverlayClick' : true, 'autoScale' : <?php echo ($autoscale == 1) ? 'true' : 'false' ?>, 'changeFade' : 'fast', 'enableEscapeButton' : true, 'overlayOpacity' : '0.3', 'onStart' : function(currentArray,currentIndex){ var obj = currentArray[ currentIndex ]; this.title = $(obj).find('img').attr("alt"); }, 'titleFromAlt' : true, 'titlePosition' : 'inside' }); }); </script>Now this code has been taken out of class-fire-ressources.php and has been placed in tc-scripts.min.js (I understand why: the performance will be much better — and my hack for getting individual titles is now included in the theme’s functionality).
However, I still require:
'overlayShow' : true, 'hideOnOverlayClick' : true, 'overlayOpacity' : '0.3', 'titlePosition' : 'inside'I can, of course go in and modify the minified file and I’ve found that it works if I do so. But (a) it’s overwritten when the theme is updated and (b) editing a minified file is a bit of a pain.
Can someone tell me the “correct” way to modify my child theme to change some of the javascript variable values?
The topic ‘How to make changes to Fancybox javascript values?’ is closed to new replies.
