PageSourceSearch

https://www.homemate-research-bus.com/js/jquery.font_resize_def17.js

js homemate-research-bus.com collected 2026-09-25 09:49:32 UTC 3,473 bytes, 76 lines download raw bytes

1/*==========================================================
2プラグイン jquery.font_size.js
3
4*フォントサイズを(小・中・大)変更
5  ボタンにclass="btn"と各id="font_s"/"font_m"/"font_l"をつける
6  デフォルト(中)のサイズにclass="active"をつける (→CSSでスタイル変更)
7
8  option
9    ・target (必須) = 変更したい要素を$(" ")の中に入る形式で記述
10    ・except (任意) = targetの中から除外したい要素を指定。セレクタの記述方法。復数の場合はカンマで区切る
11      ex.  except : "p, .mo_ox>p, #bnr_box"
12    ・resize (任意) = デフォルトのフォントサイズを変更したい場合 変更したいデバイスを指定→ sp(スマホ),tb(タブレット),pc(PC) [小,中,大] の順番で値を配列で記述 
13      ex.  resize : { 'sp' : [12,13,14] ,'tb': [15,16,18] , 'pc' : [ 14,16,18 ]} 
14last modify : 2015/11/20 227_suzuki
15==========================================================*/
16
17$(function() {
18    jQuery.fn.fontResize = function( config ){
19        config = jQuery.extend( {
20                target : 'p',
21                except : '',
22                resize : ''
23            },config);
24
25        if ((navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') > 0) || navigator.userAgent.indexOf('iPod') > 0 || (navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1)) {
26            //スマホ(iPhone,iPod touch,Android)の場合
27            var defaults = { 
28              font_s : 15,
29              font_m : 17,
30              font_l : 19 
31              }; 
32              if(config.resize.sp && config.resize.sp.length == 3){
33                defaults.font_s =  config.resize.sp[0]
34                defaults.font_m =  config.resize.sp[1]
35                defaults.font_l =  config.resize.sp[2]
36              }
37        }else if(navigator.userAgent.indexOf('Android') > 0 || navigator.userAgent.indexOf('iPad') > 0){
38            //タブレット(iPad,Androidタブレット)の場合
39             var defaults = { 
40              font_s : 15,
41              font_m : 17,
42              font_l : 19 
43              };
44              if(config.resize.tb && config.resize.tb.length == 3){
45                defaults.font_s =  config.resize.tb[0]
46                defaults.font_m =  config.resize.tb[1]
47                defaults.font_l =  config.resize.tb[2]
48              }
49        }else{
50            //その他(PC)の場合
51             var defaults = { 
52              font_s : 15,
53              font_m : 17,
54              font_l : 19 
55              };
56              if(config.resize.pc && config.resize.pc.length ==3 ){
57                defaults.font_s =  config.resize.pc[0]
58                defaults.font_m =  config.resize.pc[1]
59                defaults.font_l =  config.resize.pc[2]
60              }
61        }
62        var target = $(config.target);
63        var except = $(config.except);
64        var resize = defaults;
65     
66        $(this).find(".btn").click(function(){
67            $(this).parent().find(".btn").each(function(){
68                $(this).removeClass('active');
69            });
70            $(this).addClass('active');
71            var current = this.id;
72            target.not(except).css("font-size", resize[current] + "px");
73        });
74    };
75});
76

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.