forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
031e41b
commit ae319c8
Showing
2 changed files
with
63 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,52 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>中国站长天空-网页特效-时间特效-</title> | ||
<meta http-equiv="content-Type" content="text/html;charset=gb2312"> | ||
<!--把下面代码加到<head>与</head>之间--> | ||
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" /> | ||
<object id="VMLRender" codebase="vgx.dll" classid="CLSID:10072CEC-8CC1-11D1-986E-00A0C955B42E"> | ||
</object> | ||
<style> | ||
<!-- | ||
v\:* { behavior: url(#VMLRender); } | ||
--> | ||
</style> | ||
<script language="JavaScript1.2"> | ||
<!-- | ||
/* | ||
DHTML analog clock II | ||
*/ | ||
//specify clock size in pixels | ||
var clocksize=135 | ||
function updatePointers() { | ||
var now = new Date(); | ||
secondsPointer.style.rotation = now.getSeconds() * 6; | ||
minutesPointer.style.rotation = now.getMinutes() * 6 + now.getSeconds() / 10; | ||
hoursPointer.style.rotation = now.getHours() * 30 + now.getMinutes() / 2; | ||
} | ||
if (document.all&&window.print){ | ||
window.attachEvent("onload", initVMLClock); | ||
window.attachEvent("onresize", resizeObjects); | ||
} | ||
function initVMLClock() { | ||
resizeObjects(); | ||
updatePointers(); | ||
window.setInterval("updatePointers()", 1000); | ||
} | ||
function resizeObjects() { | ||
var size = Math.min(clocksize, clocksize); | ||
clock.style.pixelWidth = size - 2*(size * 0.045); | ||
clock.style.pixelHeight = size - 2*(size * 0.045); | ||
|
||
clock.childNodes.item(0).childNodes.item(0).weight = size * 0.01; | ||
secondsPointer.childNodes.item(0).childNodes.item(0).weight = size * 0.001; | ||
minutesPointer.childNodes.item(0).childNodes.item(0).weight = size * 0.002; | ||
hoursPointer.childNodes.item(0).childNodes.item(0).weight = size * 0.004; | ||
} | ||
function toggle(sId) { | ||
var el = document.getElementById(sId); | ||
el.style.display = (el.style.display == "none") ? "block" : "none"; | ||
} | ||
//--> | ||
</script> | ||
</head> | ||
<body> | ||
<!--把下面代码加到<body>与</body>之间--> | ||
<v:group id="clock" coordsize="100 100" style="position: relative;"> | ||
<v:oval style="width: 100%; height: 100%"> | ||
<v:stroke weight="10px" color="gray"/> | ||
<!-- I removed this gradient fill to match the WebFX color theme | ||
<v:fill type="gradient" color="white" color2="#eeeeff" angle="225deg"/>--> | ||
</v:oval> | ||
<v:group id="secondsPointer" style="width: 100%; height: 100%; position: absolute; top: 0px; left: 0px;"> | ||
<v:line from="50,50" to="50,5"> | ||
<v:stroke weight="2px" endcap="round" color="navy"/> | ||
</v:line> | ||
</v:group> | ||
<v:group id="minutesPointer" style="width: 100%; height: 100%; position: absolute; top: 0px; left: 0px;"> | ||
<v:line from="50,50" to="50,8"> | ||
<v:stroke weight="4px" endcap="round" color="navy"/> | ||
</v:line> | ||
</v:group> | ||
<v:group id="hoursPointer" style="width: 100%; height: 100%; position: absolute; top: 0px; left: 0px;"> | ||
<v:line from="50,50" to="50,18"> | ||
<v:stroke weight="7px" endcap="round" color="navy"/> | ||
</v:line> | ||
</v:group> | ||
</v:group> | ||
</body> | ||
</html> | ||
<head> | ||
<title>TODO supply a title</title> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<script src="avalon.repeat.js"></script> | ||
<script> | ||
avalon.define("xxx", function(vm) { | ||
vm.data = [{checked: false}, {checked: false}, {checked: false}] | ||
vm.allchecked = false | ||
vm.$one = "yyyyyyyyyyy" | ||
vm.checkAll = function() { | ||
|
||
var vmodel = avalon.vmodels.xxx | ||
var bool = vmodel.allchecked = this.checked | ||
vmodel.data.forEach(function(el) { | ||
el.checked = bool | ||
}) | ||
} | ||
vm.checkOne = function($index) { | ||
var vmodel = avalon.vmodels.xxx | ||
avalon.bind("click", this, function() { | ||
setTimeout(function() { | ||
console.log($index) | ||
if (!this.checked) { | ||
vmodel.allchecked = false | ||
} else { | ||
vmodel.allchecked = vmodel.data.every(function(el) { | ||
return el.checked | ||
}) | ||
} | ||
}) | ||
}) | ||
|
||
} | ||
}) | ||
</script> | ||
</head> | ||
<body> | ||
|
||
<table ms-controller="xxx" border="1"> | ||
<tr> | ||
<td><input type="checkbox" ms-duplex-radio="allchecked" data-duplex-changed="checkAll"/>全选{{$one}}</td> | ||
</tr> | ||
<tr ms-repeat="data"> | ||
<td><input type="checkbox" ms-duplex-radio="el.checked" ms-scan="checkOne(el,$index)"/>xxxxxxxxxxxx</td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |