我正在开发中angular.js和HTML一个应用程序的颜色,我被困在一个地方如何改变DIV
有顶部下拉,在下拉菜单的变化我想改变的背景颜色一些像在图像中给出的单元格。
这里是我的代码片段:
HTML页面controller.js
Here is the click event of dropdown change:
$(function() {
$('#seldate').change(function() {
//Here i want to change color of cell located in 1st row and 1st column
//also i want to change color of cell located in 2nd row and 2nd column
})
})
如何更改单元格的背景颜色
<div class="row">
<div class="col col1" style="-webkit-box-shadow: 0 0 20px 0px #999;background-color: #11c1f3;text-align: center;">
<h3 style="color: white">Time Slot</h3>
</div>
<div class="col col1" ng-repeat="time in timeArray" style="background-color: #e0e0e0;text-align: center">
{{time}}
</div>
</div>
<!-- <div id="selectedDateRange"> -->
<div class="row" ng-repeat="(dateindex, date) in dateArray">
<div class="col col1" style="-webkit-box-shadow: 0 0 20px 0px #999;background-color: #11c1f3;text-align: center;">
<h3 style="color: white">{{date}}</h3>
</div>
<div class="col col1" ng-repeat="(timeindex, time) in timeArray" ng-click="selectCell(dateindex, timeindex)" ng-class="{'selected': selectedCell[0] == dateindex && selectedCell[1] == timeindex}"></div>
</div>
代码?
请帮助和提前致谢!
你为什么在使用ng-change时使用jquery'.change()'? –