4
我是AngularJS中的新成员,我如何使用AngularJS在mouseover
上弹出一个div。如果我调整鼠标悬停div,它会改变整个结构,如何显示弹出div而不会干扰邻居元素。在Angularjs中的鼠标悬停上弹出一个div
标记
<div ng-repeat="x in images | filter:test" style="float:left; width:30%" ng-mouseover="count=1" ng-mouseleave="count=0" >
<img ng-src="{{x.path}}"
style="width: 100px; height:100px"><div> {{x.company}}</div>
<div style="background-color:#E6E6FA;text-align: center;"ng-show="count">
price:{{x.price}}</br>
size:{{x.size}}</br>
</div>
</img>
<div/>
我增加额外的事情标记一样的公司,规模上mouseover
。帮我弹出mouseover
上的图像。在此先感谢
使用角度UI引导HTTPS的://angular-ui.github.io/bootstrap/看看这个plunkr http://plnkr.co/edit/a165oiq4bgmVtFvJebTG?p=preview –
@TheWarlock然后他应该在他的问题中提到......可能他不会,没有任何关于此功能的想法 –
@samyak - 你可能想要尝试基于自定义属性的指令 - https://docs.angularjs.org/guide/directive或者你可以简单地添加使用事件绑定和方法的组合添加到你的范围就像这一个 - http://stackoverflow.com/questions/22532656/NG-鼠标悬停和休假到肘节项-使用鼠标功能于angularjs –