标签:height 调色板 asc turn char run src doctype html
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<style type="text/css">
.box{
width: 200px;
height: 200px;
border: solid 1px #333;
}
</style>
</head>
<body ng-controller="MainCtrl as mainctrl">
<div class="box" ng-style="mainctrl.getColor()"></div>
<p>
r:
<input type="range" min="0" max="255" ng-model="mainctrl.r" />
<input type="text" ng-model="mainctrl.r"/>
</p>
<p>
g:
<input type="range" min="0" max="255" ng-model="mainctrl.g" />
<input type="text" ng-model="mainctrl.g" />
</p>
<p>
b:
<input type="range" min="0" max="255" ng-model="mainctrl.b" />
<input type="text" ng-model="mainctrl.b" />
</p>
<script type="text/javascript">
var myapp = angular.module("myapp",[]);
myapp.controller("MainCtrl",[function(){
this.r = 88;
this.g = 88;
this.b = 88;
this.getColor = function(){
return {"background-color":"rgb(" + this.r + "," + this.g + "," + this.b +")"};
}
}]);
</script>
</body>
</html>
标签:height 调色板 asc turn char run src doctype html
原文地址:http://www.cnblogs.com/weiluguo/p/7389135.html