1// JavaScript Document 2 3$(document).ready(function() { 4 /* 5 * Simple image gallery. Uses default settings 6 */ 7 8 $('.fancybox').fancybox(); 9 10 /* 11 * Different effects 12 */ 13 14 // Change title type, overlay closing speed 15 $(".fancybox-effects-a").fancybox({ 16 helpers: { 17 title : { 18 type : 'outside' 19 }, 20 overlay : { 21 speedOut : 0 22 } 23 } 24 }); 25 26 // Disable opening and closing animations, change title type 27 $(".fancybox-effects-b").fancybox({ 28 openEffect : 'none', 29 closeEffect : 'none', 30 31 helpers : { 32 title : { 33 type : 'over' 34 } 35 } 36 }); 37 38 // Set custom style, close if clicked, change title type and overlay color 39 $(".fancybox-effects-c").fancybox({ 40 wrapCSS : 'fancybox-custom', 41 closeClick : true, 42 43 openEffect : 'none', 44 45 helpers : { 46 title : { 47 type : 'inside' 48 }, 49 overlay : { 50 css : { 51 'background' : 'rgba(238,238,238,0.85)' 52 } 53 } 54 } 55 }); 56 57 // Remove padding, set opening and closing animations, close if clicked and disable overlay 58 $(".fancybox-effects-d").fancybox({ 59 padding: 0, 60 61 openEffect : 'elastic', 62 openSpeed : 150, 63 64 closeEffect : 'elastic', 65 closeSpeed : 150, 66 67 closeClick : true, 68 69 helpers : { 70 overlay : null 71 } 72 }); 73 74 /* 75 * Button helper. Disable animations, hide close button, change title type and content 76 */ 77 78 $('.fancybox-buttons').fancybox({ 79 openEffect : 'none', 80 closeEffect : 'none', 81 82 prevEffect : 'none', 83 nextEffect : 'none', 84 85 closeBtn : false, 86 87 helpers : { 88 title : { 89 type : 'inside' 90 }, 91 buttons : {} 92 }, 93 94 afterLoad : function() { 95 this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); 96 } 97 }); 98 99 100 /* 101 * Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked 102 */ 103 104 $('.fancybox-thumbs').fancybox({ 105 prevEffect : 'none', 106 nextEffect : 'none', 107 108 closeBtn : false, 109 arrows : false, 110 nextClick : true, 111 112 helpers : { 113 thumbs : { 114 width : 50, 115 height : 50 116 } 117 } 118 }); 119 120 /* 121 * Media helper. Group items, disable animations, hide arrows, enable media and button helpers. 122 */ 123 $('.fancybox-media') 124 .attr('rel', 'media-gallery') 125 .fancybox({ 126 openEffect : 'none', 127 closeEffect : 'none', 128 prevEffect : 'none', 129 nextEffect : 'none', 130 131 arrows : false, 132 helpers : { 133 media : {}, 134 buttons : {} 135 } 136 }); 137 138 /* 139 * Open manually 140 */ 141 142 $("#fancybox-manual-a").click(function() { 143 $.fancybox.open('1_b.jpg'); 144 }); 145 146 $("#fancybox-manual-b").click(function() { 147 $.fancybox.open({ 148 href : 'iframe.html', 149 type : 'iframe', 150 padding : 5 151 }); 152 }); 153 154 $("#fancybox-manual-c").click(function() { 155 $.fancybox.open([ 156 { 157 href : '1_b.jpg', 158 title : 'My title' 159 }, { 160 href : '2_b.jpg', 161 title : '2nd title' 162 }, { 163 href : '3_b.jpg' 164 } 165 ], { 166 helpers : { 167 thumbs : { 168 width: 75, 169 height: 50 170 } 171 } 172 }); 173 }); 174 175 176 }); 177 178 $(document).ready(function() { 179 $(".fancybox-button").fancybox({ 180 prevEffect : 'none', 181 nextEffect : 'none', 182 closeBtn : false, 183 helpers : { 184 title : { type : 'inside' }, 185 buttons : {} 186 } 187 }); 188});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.