Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我想更改单个图像的css,而不是具有相同类名的所有图像_Css_Angularjs - Fatal编程技术网

我想更改单个图像的css,而不是具有相同类名的所有图像

我想更改单个图像的css,而不是具有相同类名的所有图像,css,angularjs,Css,Angularjs,我有以下代码在我的控制器中动态生成一个图像。 我想在使用ng鼠标时更改单个图像的边框颜色,而不是所有具有相同类名的图像。这些图像都有一个唯一的id号 event.img = angular.element(`<img src="${getDartImage(event)}" ng-mouseenter="$ctrl.clicker(${$rootScope.idbull})" class="dart">`); $rootScope.idbull = event.id; event.

我有以下代码在我的控制器中动态生成一个图像。 我想在使用ng鼠标时更改单个图像的边框颜色,而不是所有具有相同类名的图像。这些图像都有一个唯一的id号

event.img = angular.element(`<img src="${getDartImage(event)}"  ng-mouseenter="$ctrl.clicker(${$rootScope.idbull})" class="dart">`);
$rootScope.idbull = event.id;
event.img = $compile(event.img)($scope);
event.img=angular.element(``);
$rootScope.idbull=event.id;
event.img=$compile(event.img)($scope);

为什么不直接使用:hover伪类?不需要。学习你的基本CSS

。您的容器img{
边框:3倍实心#000;
}
.您的容器图片:悬停{
边框颜色:#900;
}

Cleary您需要识别图像ID。您打算怎么做?