PageSourceSearch

https://sakura-vascular.com/js/utils.js

js sakura-vascular.com collected 2026-10-06 08:16:40 UTC 3,081 bytes, 115 lines download raw bytes

1// JavaScript Document
2
3//コピーライト
4//==========================================================================================
5var today = new Date();
6var nyr = today.getFullYear(); 
7
8function get_yearc(y_def) {
9	var d_now = new Date();
10	var y_now = d_now.getFullYear();
11	var str = y_def;
12	if(y_def != y_now) str += "- " + y_now;
13	return str;
14}
15
16//スムーススクロールの処理
17//==========================================================================================
18$(function(){
19
20  //スムーススクロールの処理
21  $(".smoothScrolls a").click(function(e) {
22    e.preventDefault();
23    var tt = $($(this).attr("href")).offset().top;
24    $('html, body').animate({scrollTop:tt}, 300);
25  });
26  
27})
28
29//ipad 用
30//==========================================================================================
31$(function(){
32  var $img = $('img.change');
33  
34  setNaviImgWidth();
35  
36  $(window).on('resize', function(){
37    setNaviImgWidth();
38  });
39  
40  function setNaviImgWidth(){
41    var width = window.innerWidth ? window.innerWidth: $(window).width();
42    
43    if(width > 1537){
44      $img.each(function(index, element) {
45        $(this).attr("src", $(this).attr('src').replace("_pad", "_pc"));
46      });
47    } else {
48      $img.each(function(index, element) {
49        $(this).attr("src", $(this).attr('src').replace("_pc", "_pad"));
50      });
51    }
52  }
53});
54
55//ロールオーバー
56//ロールオーバーさせたい画像にrolloverクラスをつけて使用
57//==========================================================================================
58$(function(){
59	
60	var ua = navigator.userAgent.toLowerCase();
61	 
62	// iPhone
63	var isiPhone = (ua.indexOf('iphone') > -1);
64	// iPad
65	var isiPad = (ua.indexOf('ipad') > -1);
66	// Android
67	var isAndroid = (ua.indexOf('android') > -1) && (ua.indexOf('mobile') > -1);
68	// Android Tablet
69	var isAndroidTablet = (ua.indexOf('android') > -1) && (ua.indexOf('mobile') == -1);
70	
71	if(isiPad){
72
73	}else{
74	
75	  $("img.rollover").mouseover(function(){
76	  $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
77	  }).mouseout(function(){
78	  $(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
79	  }).each(function(){
80	  $("").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
81	  });
82  
83	}
84});
85
86
87//タップで画像入れ替え
88//==========================================================================================
89var i = 1;
90$(function(){
91	$("img,input[type='image']").click(function(){
92		if (i==1){
93			$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
94			i = 2;
95		}
96		else if (i==2){
97			$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
98			i = 1;
99		}
100	});
101});
102
103
104//popup-modal
105$(function () {
106	$('.popup-modal').magnificPopup({
107		type: 'inline',
108		removalDelay: 600
109	});
110	$(document).on('click', '.popup-modal-dismiss', function (e) {
111		e.preventDefault();
112		$.magnificPopup.close();
113	});
114});
115

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.