Customize hover effect
Using only CSS properties
ion-item:hover a {
background-color: slategray !important;
}
Enhance active item appearance
To highlight an active item, you can apply a custom CSS class using ng-class.
Define the specific styles for this 'active' class.
<ion-item ng-repeat="item in familyItems" ng-class="{'activeItem': active}">
<div ng-click="selectSubFamily(item.Numfam)">{{item.Name}}</div>
</ion-item>
For instance:
<ion-content padding="true">
<ul class="product-list">
<li ng-repeat="(key, item) in products" ng-class="{'selected':item.selected}">
<div class="list card" ng-click="select_item(key)">
<p><span>{{item.title}}</span></p>
<div class="item item-image">
<img ng-src="{{item.photo}}">
</div>
</div>
</li>
</ul>
</ion-content>
// Styling
.selected {
// Highlighting style here
}
// Controller
.controller('SomeController', ['$scope', function ($scope) {
$scope.products = [
{ "title": "Super Man's Tommy Toy", "price": 20000, "thumb": "DO_RE_MI.jpg" },
{ "title": "An old picture of Seldom", "price": 1999, "thumb": "MI_RE_DO.gif" }
];
$scope.select_item = function (key) {
if ($scope.products[key]) {
$scope.products[key].selected = true;
}
}
}]);
Source