1jQuery(document).ready(function() { 2 3 /* 4 * Examples - images 5 */ 6 7 $("a#example1").fancybox({ 8 'titleShow' : false 9 }); 10 11 $("a#example2").fancybox({ 12 'titleShow' : false, 13 'transitionIn' : 'elastic', 14 'transitionOut' : 'elastic', 15 'easingIn' : 'easeOutBack', 16 'easingOut' : 'easeInBack' 17 }); 18 19 $("a#example3").fancybox({ 20 'titleShow' : false, 21 'transitionIn' : 'none', 22 'transitionOut' : 'none' 23 }); 24 25 $("a#example4").fancybox(); 26 27 $("a#example5").fancybox({ 28 'titlePosition' : 'inside' 29 }); 30 31 $("a#example6").fancybox({ 32 'titlePosition' : 'over' 33 }); 34 35 $("a[rel=example_group]").fancybox({ 36 'transitionIn' : 'none', 37 'transitionOut' : 'none', 38 'titlePosition' : 'over', 39 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { 40 return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>'; 41 } 42 }); 43 44 /* 45 * Examples - various 46 */ 47 48 $(".various").fancybox({ 49 'transitionIn' : 'none', 50 'transitionOut' : 'none' 51 }); 52 53 $("#various1").fancybox({ 54 'titlePosition' : 'inside', 55 'transitionIn' : 'none', 56 'transitionOut' : 'none' 57 }); 58 59 $("#various2").fancybox({ 60 'modal' : true 61 }); 62 63 $("#various3").fancybox({ 64 ajax : { 65 type : "POST", 66 data : 'mydata=test' 67 } 68 }); 69 70 $("#various4").fancybox({ 71 ajax : { 72 type : "POST" 73 } 74 }); 75 76 $("#various5").fancybox({ 77 'width' : 1212, 78 'height' : 600, 79 'autoScale' : false, 80 'transitionIn' : 'none', 81 'transitionOut' : 'none', 82 'type' : 'iframe' 83 }); 84 $("#various5b").fancybox({ 85 'width' : 1212, 86 'height' : 600, 87 'autoScale' : false, 88 'transitionIn' : 'none', 89 'transitionOut' : 'none', 90 'type' : 'iframe' 91 }); 92 $("#various5c").fancybox({ 93 'width' : 1212, 94 'height' : 600, 95 'autoScale' : false, 96 'transitionIn' : 'none', 97 'transitionOut' : 'none', 98 'type' : 'iframe' 99 }); 100 $("#various5d").fancybox({ 101 'width' : 1212, 102 'height' : 600, 103 'autoScale' : false, 104 'transitionIn' : 'none', 105 'transitionOut' : 'none', 106 'type' : 'iframe' 107 }); 108 $("#various5e").fancybox({ 109 'width' : 1212, 110 'height' : 600, 111 'autoScale' : false, 112 'transitionIn' : 'none', 113 'transitionOut' : 'none', 114 'type' : 'iframe' 115 }); 116 $("#various5f").fancybox({ 117 'width' : 1212, 118 'height' : 600, 119 'autoScale' : false, 120 'transitionIn' : 'none', 121 'transitionOut' : 'none', 122 'type' : 'iframe' 123 }); 124 $("#various5g").fancybox({ 125 'width' : 1212, 126 'height' : 600, 127 'autoScale' : false, 128 'transitionIn' : 'none', 129 'transitionOut' : 'none', 130 'type' : 'iframe' 131 }); 132 $("#various5h").fancybox({ 133 'width' : 1212, 134 'height' : 600, 135 'autoScale' : false, 136 'transitionIn' : 'none', 137 'transitionOut' : 'none', 138 'type' : 'iframe' 139 }); 140 $("#various5i").fancybox({ 141 'width' : 1212, 142 'height' : 600, 143 'autoScale' : false, 144 'transitionIn' : 'none', 145 'transitionOut' : 'none', 146 'type' : 'iframe' 147 }); 148 $("#various5j").fancybox({ 149 'width' : 1212, 150 'height' : 600, 151 'autoScale' : false, 152 'transitionIn' : 'none', 153 'transitionOut' : 'none', 154 'type' : 'iframe' 155 }); 156 $("#various5k").fancybox({ 157 'width' : 400, 158 'height' : 350, 159 'autoScale' : false, 160 'transitionIn' : 'none', 161 'transitionOut' : 'none', 162 'type' : 'iframe', 163 'toolbar' : false, 164 'scrollbars' : false 165 }); 166 $("#various5l").fancybox({ 167 'width' : 500, 168 'height' : 450, 169 'autoScale' : false, 170 'transitionIn' : 'none', 171 'transitionOut' : 'none', 172 'type' : 'iframe', 173 'toolbar' : false, 174 'scrollbars' : false 175 }); 176 $("#various6").fancybox({ 177 'padding' : 0, 178 'autoScale' : false, 179 'transitionIn' : 'none', 180 'transitionOut' : 'none' 181 }); 182 183 $("#various7").fancybox({ 184 onStart : function() { 185 return window.confirm('Continue?'); 186 }, 187 onCancel : function() { 188 alert('Canceled!'); 189 }, 190 onComplete : function() {
191 alert('Completed!'); 192 }, 193 onCleanup : function() { 194 return window.confirm('Close?'); 195 }, 196 onClosed : function() { 197 alert('Closed!'); 198 } 199 }); 200 201 $("#various8, #various9").fancybox(); 202 203 /* 204 * Examples - manual call 205 */ 206 207 $("#manual1").click(function() { 208 $.fancybox({ 209 //'orig' : $(this), 210 'padding' : 0, 211 'href' : 'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg', 212 'title' : 'Lorem ipsum dolor sit amet', 213 'transitionIn' : 'elastic', 214 'transitionOut' : 'elastic' 215 }); 216 }); 217 218 $("#manual2").click(function() { 219 $.fancybox([ 220 'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg', 221 '../farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg', 222 { 223 'href' : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg', 224 'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit' 225 } 226 ], { 227 'padding' : 0, 228 'transitionIn' : 'none', 229 'transitionOut' : 'none', 230 'type' : 'image', 231 'changeFade' : 0 232 }); 233 }); 234 235 /* 236 * Tips & Tricks 237 */ 238 239 $("#tip3").fancybox({ 240 'transitionIn' : 'none', 241 'transitionOut' : 'none', 242 'titlePosition' : 'over', 243 'onComplete' : function() { 244 $("#fancybox-wrap").hover(function() { 245 $("#fancybox-title").show(); 246 }, function() { 247 $("#fancybox-title").hide(); 248 }); 249 } 250 }); 251 252 $("#tip4").click(function() { 253 $.fancybox({ 254 'padding' : 0, 255 'autoScale' : false, 256 'transitionIn' : 'none', 257 'transitionOut' : 'none', 258 'title' : this.title, 259 'width' : 680, 260 'height' : 495, 261 'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/index.html'), 262 'type' : 'swf', 263 'swf' : { 264 'wmode' : 'transparent', 265 'allowfullscreen' : 'true' 266 } 267 }); 268 269 return false; 270 }); 271 272 $("#tip5").fancybox({ 273 'scrolling' : 'no', 274 'titleShow' : false, 275 'onClosed' : function() { 276 $("#login_error").hide(); 277 } 278 }); 279 280 $("#login_form").bind("submit", function() { 281 282 if ($("#login_name").val().length < 1 || $("#login_pass").val().length < 1) { 283 $("#login_error").show(); 284 $.fancybox.resize(); 285 return false; 286 } 287 288 $.fancybox.showActivity(); 289 290 $.ajax({ 291 type : "POST", 292 cache : false, 293 url : "/data/login.php", 294 data : $(this).serializeArray(), 295 success: function(data) { 296 $.fancybox(data); 297 } 298 }); 299 300 return false; 301 }); 302 303 $("#tip6").fancybox({ 304 'transitionIn' : 'none', 305 'transitionOut' : 'none', 306 'autoScale' : false, 307 'type' : 'iframe', 308 'width' : 500, 309 'height' : 500, 310 'scrolling' : 'no' 311 }); 312 313 function formatTitle(title, currentArray, currentIndex, currentOpts) { 314 return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>'; 315 } 316 317 $(".tip7").fancybox({ 318 'showCloseButton' : false, 319 'titlePosition' : 'inside', 320 'titleFormat' : formatTitle 321 }); 322 323 324 // Next JS snippets are only for fancybox.net 325 326 /* 327 * Donate link 328 */ 329 $("a#donate").bind("click", function() { 330 $("#donate_form").submit(); 331 return false; 332 }); 333 334 /* 335 * Zebra-stripping table 336 */ 337 338 $("table.options tr:even").addClass('even'); 339 340});
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.