PageSourceSearch

https://img.technews.tw/wp-content/themes/twentytwelve/js/lazy-iframe.js?ver=4.7.2

js technews.tw collected 2026-10-01 10:11:45 UTC 935 bytes, 30 lines download raw bytes

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.