<html ng-app="myApp">
<head>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script src= "https://raw.githubusercontent.com/jquery/jquery-color/master/jquery.color.js"></script>
<script>
myApp=angular.module('myApp',[])
.controller('myController',function($scope) {
$scope.myTextColor = ['Red','Blue','Yellow','Green','Aqua','Purple','Gray','Fuchsia','Lime','Maroon','Navy','Olive','Silver','Teal'];
$scope.changecolor = $scope.myTextColor[0];
});
$(document).ready(function() {
$("#changecolor").change(function() {
$("#header1").animate({color : $("#changecolor option:selected").text().toLowerCase()},1000);
});
});
</script>
</head>
<body ng-controller="myController">
Select Text Color : <select id="changecolor" ng-model="changecolor" ng-options="option for option in myTextColor"></select>
<h1 id="header1">I am flexible to change my color anytime you want to. </h1>
</body>
</html>
Select Text Color :
No comments:
Post a Comment