Commit 7f1e232b by o.kimura

JS記述変更

parent 9263c86b
Showing with 74 additions and 73 deletions
/* header電話番号拡大 */
jQuery(function() {
jQuery('#head_contact li:first-child + *').attr('id','head_contact_tel');
jQuery('#head_contact_tel img').hover (
function () {
jQuery('#head_contact_tel img').attr('src', '/common/img/header_freedial_hotton.png');
},function () {
jQuery('#head_contact_tel img').attr('src', '/common/img/header_freedial.png');
}
);
})
/* site search */
jQuery(function() {
var cx = '012834083069365124613:clp9ogaosg0';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})
/* image rollover */
function smartRollover() {
if (document.getElementsByTagName) {
var images = document.getElementsByTagName("img");
for (var i=0; i < images.length; i++) {
if (images[i].getAttribute("src").match("_off.")) {
images[i].onmouseover = function() {
this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
}
images[i].onmouseout = function() {
this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
}
}
}
}
}
if (window.addEventListener) {
window.addEventListener("load", smartRollover, false);
}
else if (window.attachEvent) {
window.attachEvent("onload", smartRollover);
}
/* smooth scroll */
jQuery(function(){
// #で始まるアンカーをクリックした場合に処理
jQuery('a[href^=#]').click(function() {
var speed = 400;
var href= jQuery(this).attr("href");
var target = jQuery(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
jQuery('body,html').animate({scrollTop:position}, speed, 'swing');
//return false;
});
});
/* page top */
jQuery(function() {
jQuery('.page_top').click (function() {
jQuery('html,body').animate({scrollTop:0}, 'slow');
return false;
});
});
/* gNav_dropdown */
$(function(){
$("li.gNav_dropdown").hover(function(){
$("ul.gNav_dropdown_item:not(:animated)", this).slideDown();
}, function(){
$("ul.gNav_dropdown_item",this).slideUp();
});
/* header電話番号拡大 */
jQuery(function() {
jQuery('#head_contact li:first-child + *').attr('id','head_contact_tel');
jQuery('#head_contact_tel img').hover (
function () {
jQuery('#head_contact_tel img').attr('src', '/common/img/header_freedial_hotton.png');
},function () {
jQuery('#head_contact_tel img').attr('src', '/common/img/header_freedial.png');
}
);
})
/* site search */
jQuery(function() {
var cx = '012834083069365124613:clp9ogaosg0';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})
/* image rollover */
function smartRollover() {
if (document.getElementsByTagName) {
var images = document.getElementsByTagName("img");
for (var i=0; i < images.length; i++) {
if (images[i].getAttribute("src").match("_off.")) {
images[i].onmouseover = function() {
this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
}
images[i].onmouseout = function() {
this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
}
}
}
}
}
if (window.addEventListener) {
window.addEventListener("load", smartRollover, false);
}
else if (window.attachEvent) {
window.attachEvent("onload", smartRollover);
}
/* smooth scroll */
jQuery(function(){
// #で始まるアンカーをクリックした場合に処理
jQuery('a[href^=#]').click(function() {
var speed = 400;
var href= jQuery(this).attr("href");
var target = jQuery(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
jQuery('body,html').animate({scrollTop:position}, speed, 'swing');
//return false;
});
});
/* page top */
jQuery(function() {
jQuery('.page_top').click (function() {
jQuery('html,body').animate({scrollTop:0}, 'slow');
return false;
});
});
/* gNav_dropdown */
jQuery(function() {
jQuery("li.gNav_dropdown").hover(function(){
jQuery("ul.gNav_dropdown_item:not(:animated)", this).slideDown();
}, function(){
jQuery("ul.gNav_dropdown_item",this).slideUp();
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment