-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
122 lines (105 loc) · 2.7 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
$(function(){
$('.thankyou').show();
$('header a').click(function(){
var id = $(this).attr('href');
var position = $(id).offset().top;
$('html, body').animate({
'scrollTop': position-130
}, 1000);
});
$('#site-title').click(function(){
$('html, body').animate({
'scrollTop': 0
}, 1500);
});
$('#footer-title').click(function(){
$('html, body').animate({
'scrollTop': 0
}, 1500);
});
var showContents = $('.show-contents');
showContents.hide();
$(window).scroll(function(){
if($(this).scrollTop()>300){
showContents.fadeIn(2000);
}else{
showContents.fadeOut();
}
});
$('#hidden-switch').click(function(){
$('#hidden-menu').fadeIn();
});
$('#close').click(function(){
$('#hidden-menu').fadeOut();
});
$('.slideshow').each(function(){
var $slides = $(this).find('img'),
$slideCount = $slides.length,
currentIndex = 0;
$slides.eq(currentIndex).fadeIn();
setInterval(showNextSlide,7500);
function showNextSlide(){
var nextIndex = (currentIndex + 1) % slideCount;
$slides.eq(currentIndex).fadeOut();
$slides.eq(nextIndex).fadeIn();
currentIndex = nextIndex;
}
});
});
/* js rotate example
CSS
.rotateH, .rotateW {
position: relative;
width: 400px;
height: 300px;
}
.rotateH img, .rotateW img {
position: absolute;
top: 0;
left: 0;
JavaScript
$(function() {
var rotationSpeed = 150;
// 縦回転の初期設定
$('.rotateH .reverse').each(function() {
$(this).css({
height: 0,
marginTop: $(this).height() / 2
});
});
// 縦回転の処理
$(".rotateH").hover(function() {
// 表面の非表示
$('.surface', this).animate({
height: 0,
marginTop: $(this).height() / 2
}, rotationSpeed);
// 裏面の表示
$('.reverse', this).delay(rotationSpeed).animate({
height: $(this).height(),
marginTop: '0'
}, rotationSpeed);
}, function() {
// 裏面の非表示
$('.reverse', this).animate({
height: 0,
marginTop: $(this).height() / 2
}, rotationSpeed);
// 表面の表示
$('.surface', this).delay(rotationSpeed).animate({
height: $(this).height(),
marginTop: '0'
}, rotationSpeed);
});
js rotate example end*/
/* message show
$('#works-image').hover(
function(){
$('#show-message').css('display','block');
$('#show-message').css('z-index',-1);
},
function(){
$('#show-message').css('display','none');
}
);
show message end */