PageSourceSearch

https://kana-pianolesson.com/static/js/header_height_auto.js

js kana-pianolesson.com collected 2026-10-07 23:45:24 UTC 1,757 bytes, 43 lines download raw bytes

1window.onload = function() {
2    if($('.hd_auto')[0]) {
3        setImgHeight();
4    } else {
5        var hdAutoTimer = setInterval(function() {
6            if($('.hd_auto')[0]) {
7                setImgHeight();
8                clearInterval(hdAutoTimer);
9            }
10        }, 500);
11    }
12};
13window.addEventListener('resize', function (event) {
14    setImgHeight();
15});
16function setImgHeight() {
17    var is_hd_auto = document.getElementsByClassName('hd_auto').length;
18    if(is_hd_auto > 0){
19        var hptn1 = document.getElementsByClassName('hptn1')[0];
20        if(hptn1)var background = hptn1.getAttribute("style");
21        if(background){
22            var is_img = background.match('url');
23            // 画像が設定されてあるかどうか
24            if(is_img){
25                var img_url_str = is_img['input'].match(/url\(.+?\)/);
26                var img_width_and_height = img_url_str[0].match(/(?!.+\/).+(?=\.)/);
27                var img_width_str = img_width_and_height[0].match(/[\d]+/)[0];
28                var img_height_str = img_width_and_height[0].match(/\_[\d]+/)[0];
29                img_height_str = img_height_str.match(/[\d]+/)[0];
30                var imgWidth = parseInt(img_width_str);
31                var imgHeight = parseInt(img_height_str);
32                var windowWidth = document.documentElement.clientWidth;
33                if(windowWidth <= hptn1.clientWidth) {
34                    var height = Math.floor(windowWidth * imgHeight / imgWidth);
35                    hptn1.style.height = height + 'px';
36                } else {
37                    var height = Math.floor(hptn1.clientWidth * imgHeight / imgWidth);
38                    hptn1.style.height = height + 'px';
39                }
40            }
41        }
42    }
43}

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.