Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
sora
/
keio-dentetsu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7f1e232b
authored
Aug 31, 2020
by
o.kimura
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
JS記述変更
parent
9263c86b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
73 deletions
common/js/script_wp.js
common/js/script_wp.js
View file @
7f1e232b
/* 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment