我们如何同时将鼠标悬停在html中的多个div上?
我在html页面中有两个不同位置的div.
我想悬停在任何div和它上面,而另一个div则被选中.
我怎样才能使用优选的css属性来完成它?目前它从父母到孩子而不是反过来,我尝试了所有不同的组合.甚至〜和+属性.
HTML代码:
<div id=one1>
<div id=two2></div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#one1:hover { background-color: yellow;}
#two2:hover { background-color: yellow;}
Run Code Online (Sandbox Code Playgroud) function demo() {
var test = [{
level: 19,
title: "hello1"
}, {
level: 2,
title: "hello2"
},
{
level: 5,
title: "hello5"
}];
Run Code Online (Sandbox Code Playgroud)
我想对这个数组进行排序,但无法找到一种方法.
我有两个不同的模块,第一个包含控制器的第二个指令。
基本上,我希望directive在我的渲染view。但是,随着modules对directive和controller是不同的,它给错误。
如果我给的相同,module那么我希望为所有控制器提供服务的通用模块可以解决我的问题。
controller
angular.module('SlamModuleCtrl')
.controller('SlambookExt',['$scope','$route','SlambookCollection', function($scope,$route) {
console.log("slam controller")
}]);
Run Code Online (Sandbox Code Playgroud)
Directive
angular.module('Genericmodule')
.directive('appVersion', ['version', function (version) {
return {
restrict: 'E',
template: '<h1>version1</h1>'
}
}])
Run Code Online (Sandbox Code Playgroud)
View
<div ng-controller="SlambookExt">
<app-version>1</app-version>
</div>
Run Code Online (Sandbox Code Playgroud) dependency-injection angularjs angular-directive angular-controller
我得到了这个函数来预测输出.这是说参考错误,我还在想为什么?
if(function x(){console.log("ABC");})
{
x();
}
Run Code Online (Sandbox Code Playgroud)
希望有人可以对词汇范围有所了解.提前致谢.
javascript ×2
angularjs ×1
css ×1
css3 ×1
function ×1
html ×1
if-statement ×1
json ×1
sorting ×1