所以我有这个酥料饼这是工作好,这里是酥料饼的HTML:如何将inline-javascript移动到脚本标记?
<div class="popover2" onmouseover="$(this).mouseleave(function() {$(this).hide(); });">
<div class="arrow"></div>
<div class="popover2-inner">
<span class="popover2-title">Popover() 2</span>
<div class="popover2-content">
<ul class="unstyled">
<li><span>$200 Bronze</span><p>2 hrs. drivers training</p </li>
</ul>
</div>
</div>
而且我得到这个实例代码:
$('.popover2-test').popover({
placement:'bottom',
template: $('.popover2'),
trigger: 'manual',
animate: false,
html: true,
}).click(function(e) {
e.preventDefault() ;
}).mouseenter(function(e) {
$(this).popover('show');
});
但我想将内嵌的onmouseover javascript东西移动到实例化代码中。我不知道该怎么做。任何帮助都很好,谢谢。
给标签中的ID,然后只需在绑定JS事件。除非那是该类的唯一标签,在这种情况下,您可以简单地使用该类。 – TheZ
你必须更具体,我不知道你在说什么,对不起,谢谢! – dezman