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