This repository has been archived by the owner on Apr 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sou.js
51 lines (51 loc) · 1.66 KB
/
sou.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
$(document).ready(function() {
//判断窗口大小,添加输入框自动完成
var wid = $("body").width();
if (wid < 640) {
$(".wd").attr('autocomplete', 'off');
}else{
$(".wd").focus();
}
//按钮
$(".sou li").click(function() {
var dt = $(this).attr('data-s');
wd = $(".wd").val();
if (dt == "google") {
if (wd == "" || wd == null) {
window.location.href = "https://www.google.com/?hl=zh";
} else {
$("form").attr('action', 'https://www.google.com/search?hl=zh');
$(".wd").attr("name","q");
$(".t").val("g");
$("form").submit();
}
} else {
if (wd == "" || wd == null) {
window.location.href = "https://www.baidu.com/?tn=simple";
} else {
$("form").attr('action', 'https://www.baidu.com/s?ie=utf-8');
$(".wd").attr("name","wd");
$(".t").val("b");
$("form").submit();
}
}
});
//菜单点击
$("#menu").click(function(event) {
$(this).toggleClass('on');
$(".list").toggleClass('closed');
$(".mywth").toggleClass('hidden');
});
$("#content").click(function(event) {
$(".on").removeClass('on');
$(".list").addClass('closed');
$(".mywth").removeClass('hidden');
$('#word').hide();
});
$(".mywth").click(function(event) {
var wt = $("body").width();
if (wt < 750 || wt == 750) {
window.location.href = "https://apip.weatherdt.com/h5.html?id=pjICbzAo4C";
}
});
});