We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    I have some fancybox script, i need to reduce the script, how can i do this?
    i need to have some rel="fancy1" fancy2 fancy3 etc.
    It does work like this:
    	<script type="text/javascript">
    		$(document).ready(function() {
    
    			$("a[rel=fancypop1]").fancybox({
    				'transitionIn'		: 'elastic',
    				'transitionOut'		: 'elastic',
    				'titlePosition' 	: 'over',
    				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
    					return '<span id="fancybox-title-over">Afbeelding ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? '   ' + title : '') + '</span>';
    
    				}
    			});
    
    			$("a[rel=fancypop2]").fancybox({
    				'transitionIn'		: 'elastic',
    				'transitionOut'		: 'elastic',
    				'titlePosition' 	: 'over',
    				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
    					return '<span id="fancybox-title-over">Afbeelding ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? '   ' + title : '') + '</span>';
    
    				}
    			});
    		});
    	</script>


    I need to reduce this script to minimum and not repeat transition position and titlebox over etc.
    im no js expert sad
      Evolution user, I like the back-end speed and simplicity smiley