1//å°è¦çªç¯åå §çiframe çdata-srcç§»å°src, é²è¡http request 2function setIframe() { 3 jQuery('iframe').each(function(){ 4 $this = jQuery(this); 5 $data_src = $this.attr('data-src'); 6 if ( $data_src != '' && $this.is_on_screen()) { 7 8 $this.attr('src', $data_src); 9 $this.attr('data-src', ''); 10 11 } 12 }); 13} 14 15//jquery custom function: 檢æ¥elementæ¯å¦å¨è¦çªå¯è¦ç¯åå § 16jQuery.fn.is_on_screen = function(){ 17 var win = jQuery(window); 18 var viewport = { 19 top : win.scrollTop(), 20 left : win.scrollLeft() 21 }; 22 viewport.right = viewport.left + win.width(); 23 viewport.bottom = viewport.top + win.height(); 24 25 var bounds = this.offset(); 26 bounds.right = bounds.left + this.outerWidth(); 27 bounds.bottom = bounds.top + this.outerHeight(); 28 29 return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 30};
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.