我正在開發中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()'? –