Javascript 当元素悬停在上方时,如何更改路线?
我知道Javascript 当元素悬停在上方时,如何更改路线?,javascript,html,angularjs,twitter-bootstrap,Javascript,Html,Angularjs,Twitter Bootstrap,我知道ng mouse=ng href…不是正确的语法,但这正是我想要做的。当鼠标悬停在元素上时,如何更改href 一种方法是执行以下操作: ng-mouseover="yourFunction(link.linkName)" 然后在控制器中: $scope.yourFunction=function(where){ $window.location.href = where; //or $state.go('some.state'); if you use state
ng mouse=ng href…
不是正确的语法,但这正是我想要做的。当鼠标悬停在元素上时,如何更改href
-
一种方法是执行以下操作:
ng-mouseover="yourFunction(link.linkName)"
然后在控制器中:
$scope.yourFunction=function(where){
$window.location.href = where;
//or $state.go('some.state'); if you use states.
}
记住在控制器中包含“$window”或“$state”,具体取决于您使用的控制器 这与CSS有什么关系?
ng mouse
是您制定的指令吗?看起来您想要的是使用ng mouseover
。让它在控制器中调用一个函数,返回您想要的内容。@actimel可能是bcoz ofclass=“hvr bubble right”
:D