GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 搜狐辩论投票 · niilante/javaScript-4@bdde5ec

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • 搜狐辩论投票
    • html
      • 搜狐辩论投票.html
    • images
      • bg.gif
      • green.gif
      • red.gif
      • vs.gif
    • js
      • jquery.min.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎搜狐辩论投票/html/搜狐辩论投票.html‎

Copy file name to clipboard
+58Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
<style>
7+
body{font-size:12px;color:#666;background: #fff;}
8+
#box_bg{width:440px;height:10px;background:url(../images/bg.gif) no-repeat;padding:24px 48px;margin:0 auto;}
9+
#container{height:10px;position:relative;}
10+
.line{height:10px;position:absolute;}
11+
#white,#green{width:100%;}
12+
#green{background:url(../images/green.gif) repeat-x #00FF00;height:10px;}
13+
#red{background:url(../images/red.gif) repeat-x #FF0000;height:10px;width:50%;}
14+
#white{background-color:yellow}
15+
#vs{width:40px;height:40px;background:url(../images/vs.gif) no-repeat;line-height:40px;text-align:center;position:absolute;left:205px;top:-10px;display:none}
16+
.scope{height:24px;text-align:center;}
17+
.scope span{color:#FF3300;font-weight:bold;padding:0 5px;}
18+
#all2{margin:0 auto }
19+
#aa2{float:left}
20+
#bb2{float:right}
21+
</style>
22+
</head>
23+
<body>
24+
<div id="box_bg">
25+
<div id="container">
26+
<!--绿色条层级在最下面,宽度为100%-->
27+
<div id="green" class="line"></div>
28+
<!--红色条在绿色条上面,宽度为50%-->
29+
<div id="red" class="line"></div>
30+
<!--白色条在最上边,最开始是遮住红绿色条的-->
31+
<div id="white" class="line"></div>
32+
<div id="vs"></div>
33+
</div>
34+
</div>
35+
<div style="width:440px; margin:0 auto;">
36+
<div id="aa2" class="scope">正方<span id="aa"></span>票</div>
37+
<div id="bb2" class="scope">反共<span id="bb"></span>票</div>
38+
<div id="all2" class="scope">总共<span id="all"></span>票</div>
39+
</div>
40+
</body>
41+
<script src="../js/jquery.min.js"></script>
42+
<script>
43+
$(document).ready(function () {
44+
var a = 500; //可以改为动态
45+
var b = 130;
46+
$("#white").animate({ width: 0, left: "220px" }, 1000, function () { //宽度变为0的同时,让位置往左边移动父级(box_bg,container)的一半,正好到中间,形成红绿条同时出现
47+
$("#vs").fadeIn("slow", function () {
48+
$("#all").html(a + b);
49+
$("#aa").html(a);
50+
$("#bb").html(b);
51+
var newLeft = a / (a + b) * 440 - 20 + "px"; //计算红绿条的百分比,440为总长度,20为vs宽度的一半
52+
$("#vs").animate({ left: newLeft }, 1000);
53+
$("#red").animate({ width: newLeft }, 1000);
54+
});
55+
});
56+
});
57+
</script>
58+
</html>
Collapse file

‎搜狐辩论投票/images/bg.gif‎

Copy file name to clipboard
6.44 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎搜狐辩论投票/images/green.gif‎

Copy file name to clipboard
113 Bytes
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎搜狐辩论投票/images/red.gif‎

Copy file name to clipboard
111 Bytes
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎搜狐辩论投票/images/vs.gif‎

Copy file name to clipboard
1.62 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎搜狐辩论投票/js/jquery.min.js‎

Copy file name to clipboardExpand all lines: 搜狐辩论投票/js/jquery.min.js
+4Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.