-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1.js
174 lines (160 loc) · 5.93 KB
/
1.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/* ################################ jqury ################################ */
$(document).ready(function(){
/*############################Right side of the head####################################*/
$(".HD .header .header_deng ul li").hover(
function(){
$(this).css("background-color","#ffe4c4");
$(this).find("a").css( "text-decoration","underline");}
,function(){
$(this).css("background-color","#89b4cebd");
$(this).find("a").css( "text-decoration","none")
});
/*############################Navigation section####################################*/
$(".DH .daohang ul li").hover(
function(){
$(this).css("background-color","#89b4cebd")//Override to change color
},function(){
$(this).css("background-color","#FFFFFF")
});
/************* More ingredients change color *************/
$(".CT .content .content_c2 .food_material1 .more a").hover(function(){
$(this).css({
"color":"red",
"text-decoration":"underline"
});
},function(){
$(this).css({
"color":"#3B3B3B",
"text-decoration":"none"
});
});
$(".food_material2 .food_up .food_u").mouseover(function(){
$(this).toggleClass("food_p1");//Checks for the class specified in each element. Add the class if it does not exist, or remove it if it is already set. This is called the toggle effect
$(this).find("a").toggleClass("food_p2");
var index=$(this).index();
$(".food_d").eq(index).css("display","block");
$(".food_d").eq(index).siblings().css("display","none");
});
$(".food_material2 .food_up .food_u").mouseout(function(){
$(this).toggleClass("food_p1");
$(this).find("a").toggleClass("food_p2");
});
/************* the food section of a restaurant *************/
// $(".cookbook .book2 ul .cook2").hover(function(){//Food Bar Mouse Events
// $(this).find(".cook221").css("display","none");
// $(this).find(".cook222").css("display","block");
// },function(){
// $(this).find(".cook222").css("display","none");
// $(this).find(".cook221").css("display","block");
// });
//Food Bar Optimized Slide Animation
$(".cookbook .book2 ul .cook2").on("mouseenter", function () {
var _this = $(this);
_this.find("div.cook221").stop().animate({marginTop: "-60px"}, 400, function () {
});
});
//鼠标离开
$(".cookbook .book2 ul .cook2").on("mouseleave", function () {
var _this = $(this);
_this.find("div.cook221").stop().animate({marginTop: "0px"}, 400, function () {
});
});
/***底部链接栏效果****/
/*****鼠标覆盖变红***/
$(".BM .bottom .bot_s dd a").hover(function(){
$(this).css ({
"color":"red",
"text-decoration":"underline"
});
},function(){
$(this).css({
"color":"dimgrey",
"text-decoration":"none"
});
});
/*****鼠标覆盖变红***/
$(".BM .bottom .bot_t .bot_t1 li").hover(function(){
$(this).css("background-color","#cc3333") ;
},function(){
$(this).css("background-color","#3B3B3B");
});
});
//onmouseover事件
function change1(lun,y){
lun.index=y;
var Time=document.getElementsByClassName("ctime2");
var time2=Time[0].getElementsByClassName("time_2");
for(var i=0;i<time2.length;i++){
time2[i].style.color="black";
time2[i].style.borderTop="3px solid black";
}
lun.style.color="#FF5151";
lun.style.borderTop="3px solid #FF5151";
var CTime=document.getElementsByClassName("ctime1");
var time1=CTime[0].getElementsByClassName("time_1");
for(var k=0;k<time1.length;k++){
time1[k].style.display="none";
}
time1[lun.index].style.display="block";
}
var sign=false;//false代表没开夜间模式
function dakemode() {
if(!sign){
$("body").css("background-color", "rgba(7,4,0,0.56)")
sign=true;
}else{
$("body").css("background-color","#ffe4c4");
sign=false;
}
}
$(function () {
var t = null;
t = setTimeout(time, 1000);//開始运行
function time() {
clearTimeout(t);//清除定时器
dt = new Date();
var year = dt.getFullYear();
var month = dt.getMonth() + 1;//(0-11,0代表1月)
var date = dt.getDate();//获取天
var num = dt.getDay();//获取星期
var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
var hour = dt.getHours();//获取时
var minute = dt.getMinutes();//获取分
var second = dt.getSeconds();//获取秒
date = extra(date);
month = extra(month);
minute = extra(minute);
second = extra(second);
document.getElementById("start").innerHTML=year + " 年 " + month + " 月 " + date + " 日 " + hour + ":" + minute + ":" + second + " " + weekday[num];
t = setTimeout(time, 1000); //设定定时器,循环运行
}
//补位函数。
function extra(x) {
//如果传入数字小于10,数字前补一位0。
if (x < 10) {
return "0" + x;
} else {
return x;
}
}
$(function(){
var index = 0;//用来表示显示第几张图片,初始显示第一张图片
var length = $(".slider>ul>li").length;//表示列表项的数目
$(".arrow-right").click(function(){
index++;
if(index == length){index=0;}
$(".slider>ul>li").eq(index).fadeIn().siblings().fadeOut();
});
$(".arrow-left").click(function(){
index--;
if(index == -1){index=length-1;}
$(".slider>ul>li").eq(index).fadeIn().siblings().fadeOut();
});
});
$(function () {
$('.hotSP span').hover(function () {
var index = $(this).index();
$(this).addClass('isSelect').siblings().removeClass('isSelect');
$(this).parent().next().find('.articleContent').hide().eq(index).show();
});
})