PageSourceSearch

https://www.suntech-power.co.jp/js/common.js

js suntech-power.co.jp collected 2026-10-02 18:20:09 UTC 7,014 bytes, 255 lines download raw bytes

1//window load時
2//-----------------------------------
3$(window).load(function () {
4	//メインビジュアル画像高さ
5	$(window).resize(function () {
6		//リサイズされたら
7		$('.main_visual .main_visual-body').css({
8			'height': $('.main_img_unit').outerHeight() + 'px'
9		});
10	});
11});
12
13//リサイズされたら
14//-----------------------------------
15$(window).resize(function () {
16
17});
18
19
20// rollover
21//-----------------------------------
22function over() {
23	if (!document.getElementById) return
24	var aPreLoad = new Array();
25	var sTempSrc;
26	var aImages = document.getElementsByTagName('img');
27	for (var i = 0; i < aImages.length; i++) {
28		if (aImages[i].className == 'overImg') {
29			var src = aImages[i].getAttribute('src');
30			var ftype = src.substring(src.lastIndexOf('.'), src.length);
31			var hsrc = src.replace(ftype, '_on'+ftype);
32			aImages[i].setAttribute('hsrc', hsrc);
33			aPreLoad[i] = new Image();
34			aPreLoad[i].src = hsrc;
35			aImages[i].onmouseover = function() {
36				sTempSrc = this.getAttribute('src');
37				this.setAttribute('src', this.getAttribute('hsrc'));
38			}
39			aImages[i].onmouseout = function() {
40				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
41				this.setAttribute('src', sTempSrc);
42			}
43		}
44	}
45}
46
47
48//document ready時
49//-----------------------------------
50$(document).ready(function () {
51	over();
52
53	//sp時TELリンク
54	if (Modernizr.touch) {
55		$('.js_tel-link').each(function () {
56			var strTel = $(this).text();
57			//$(this).html($('<a>').attr('href', 'tel:' + strTel.replace(/-/g, '')).append(strTel + '</a> <i class="fa fa-external-link"></i>'));
58			$(this).html($('<a>').attr('href', 'tel:' + strTel.replace(/-/g, '')).append(strTel + '</a> '));
59		});
60	}
61
62	//ページトップへ
63	$(".js_to_top a").myPageScroll({
64		duration: 1000,
65		easing: "easeInOutExpo"
66	});
67
68	//背景メニュー黒
69	$('body').prepend('<div class="menu_overlay"></div>');
70
71	//SPメニュー
72	$('.dropdown_a-toggle').myToggleClass({
73		nav: $('.dropdown_a'),
74		navHeight: true,
75		toggleBody: $('.dropdown_a-body'),
76		mediaWidth: '640'
77	});
78	$('.sp_nav_wrap a').on('click',function(){
79		$('.dropdown_a-body').slideUp();
80		$('.menu_overlay').hide();
81		$('.sp_nav_btn ').removeClass('is_toggle-on');
82	});
83
84
85	//PCメニュー
86	$('.g_nav_item:not(".item04,.item07")').on({
87		'mouseenter': function () {
88			$('.menu_overlay').css({
89				'display': 'block'
90			});
91			$('.g_nav_link').css({
92				'background-color': '#f5f5f5'
93			});
94			$('.g_nav_link', this).css({
95				'background-color': '#fff'
96			});
97		},
98		'mouseleave': function () {
99			$('.menu_overlay').css({
100				'display': 'none'
101			});
102			$('.g_nav_link').removeAttr('style');
103		}
104	});
105
106	//	var headerH = $('header').height();
107	//ページスクロール
108	$(".js_fragment_nav a").click(function () {
109		var target = $(this).attr("href");
110		if (target.indexOf("#") != -1) {
111			$(this).blur();
112			//$('html,body').animate({ scrollTop: $(target).offset().top -headerH }, {duration: 1000, easing: 'easeInOutExpo'});
113			$('html,body').animate({ scrollTop: $(target).offset().top }, {duration: 1000, easing: 'easeInOutExpo'});
114			return false;
115		}
116	});
117
118
119	//アコーディオン
120	$('.js_accordion_trigger').css({
121		'cursor': 'pointer'
122	})
123		.bind('click', function(e){
124			$(this).parent().find('.js_accordion_submenu').slideToggle();
125			$(this).toggleClass('is_expanded');
126		});
127
128	//オーバーレイ 黒なし
129	$('.js_overlap').click(function (e) {
130		e.preventDefault();
131		var id = $(this).data('overlap-click');
132		//$('.overlap-body').removeClass('is_overlap');
133		//$('#' + id).addClass('is_overlap');
134		$('.overlap-body:not(#' + id + ')').hide();
135		$('#' + id).fadeToggle();
136	});
137  $(document).on('click', (function(e){
138    var target = $(e.target);
139    if(target.parents().andSelf().is('.js_overlap,.overlap-body')){
140      return true;
141    }
142		$('.overlap-body').hide();
143    return true;
144  }));
145	$('.js_overlap-close').click(function () {
146		$('.overlap-body').fadeOut();
147	});
148
149	//モーダル
150  //黒、枠作成
151	$('body').prepend('<div class="modal_overlay"></div><div class="modal-group">  <span class="modal-close js_modal-close"></span> </div>');
152	$('.js_modal').on('click',function (e) {
153		e.preventDefault();
154		var id = $(this).data('modal-click');
155		$('body').css({'overflow': 'hidden'});
156		$('.modal_overlay, .modal-group').css({'display': 'block'});
157
158		$('#' + id).find('.modal-body').clone().prependTo('.modal-group');
159	});
160	$('.js_modal-close, .modal_overlay').on('click',function () {
161		$('body').css({'overflow': 'auto'});
162		$('.modal-group .modal-body').remove();
163		$('.modal_overlay').css({'display': 'none'});
164		$('.modal-group').fadeOut(0);
165	});
166
167	//form
168  var toggleLocation = function() {
169		var cl = $('#location_select').val();
170		$('.location_select-body').hide();
171    if( cl == "1" || cl == "2" ){
172		  $('.location01').show();
173    }
174    if(cl == '3' || cl == '4' || cl == '5' || cl == '6')  {
175		  $('.location02').show();
176    }
177  };
178
179	$('#location_select').change(toggleLocation);
180  toggleLocation();
181
182  //初期値
183  var typeInput = $("[name='type'],[name='Usertype']");
184  var toggleRadio = function(){
185    $(".radio_event").toggle(!$("#radio01_02").is(":checked"));
186  };
187
188$(window).load(function () {
189	$('.main_visual .main_visual-body').not('.residential').css({
190		'height': $('.main_img_unit').outerHeight() + 'px'
191	});
192});
193
194
195  // responsive
196  //
197  // box_responsive
198  $('.box_responsive').on('scroll', function () {
199    var $this = $(this);
200    var l = $(this).scrollLeft();
201    if(l){
202      $this.addClass('box_responsive-scrolled');
203    }
204  });
205
206	
207
208	$(typeInput).change(toggleRadio);
209  toggleRadio();
210
211  // 検索窓
212  $('input.keywords').change(function(){
213    $(this).toggleClass("nobg", $(this).val().length != 0);
214  });
215});
216//アンカーリンク設定
217//プルダウン
218$(function () {
219	var $acd_ttl = $(".acd_anc_ttl");
220	$acd_ttl.on("click",function (){
221		if($(this).hasClass("active")) {
222			$(this).parent().find(".acd_anc_block").slideUp();
223			$(this).removeClass("active");
224		} else {
225			$acd_ttl.removeClass('active');
226			$(".acd_anc_block").slideUp();
227			$(this).parent().find(".acd_anc_block").slideDown();
228			$(this).addClass("active");
229		}
230	});
231	$(".acd_anc_block ul li a").on("click",function (){
232		$(".acd_anc_block").slideUp();
233	});
234	$(".anc_itme a").on("click",function (){
235		$(".acd_anc_block").slideUp();
236	});
237	
238	// レスポンシブ時の横矢印の表示判定
239	$(window).on('load',function() {
240		var a = 0;
241		var responsive_box = $('.box_responsive');
242		var cont_width     = $('.alpha_block').width();
243		responsive_box.each(function(){
244			a++;
245			var box_width = $(this).children('table').width();
246			if (box_width < cont_width) {
247				$(this).addClass('box_responsive-scrolled');
248			}
249		});
250	});
251	
252	
253});
254
255

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.