作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试制作某种内容幻灯片,但在使更改后的内容中的链接正常工作时遇到问题。第一个正确调用下一帧,但后续帧中的链接根本不起作用。到目前为止我的代码如下。非常感谢任何帮助。
<div class="overlaycontent">
Welcome, enjoy your stay!
<a class="mylink" data="demo" href="#">Get Started!</a>
</div>
<div id="helpDemo" style="display:none;"> This would be content 1 <a class="helplink" data="acts" href="#">Next</a> </div>
<div id="helpActs" style="display:none;"> This would be content 2 <a class="helplink" data="more" href="#">Next</a> </div>
<div id="helpMore" style="display:none;"> This would be content 3 </div>
$(".helplink").on("click",function(e){
if($(this).attr('data') == 'demo'){
$('.overlaycontent').html($('#helpDemo').html());
}
if($(this).attr('data') == 'acts'){
$('.overlaycontent').html($('#helpActs').html());
}
if($(this).attr('data') == 'more'){
$('.overlaycontent').html($('#helpMore').html());
}
});
最佳答案
改变
<a class="mylink" data="demo" href="#">Get Started!</a>
至
<a class="helplink" data="demo" href="#">Get Started!</a>
并且
$(".helplink").on("click",function(e){
至
$(".overlaycontent").on("click",".helplink",function(e){
关于jquery - 如何使更改内容中的多个链接实例发挥作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20000135/
在 Play 1.x 中有很棒的 play Idealize(和 play eclipsify),它为您最喜欢的 IDE 中的 Play 项目准备了项目文件。 我看到这是在 Play 2.X 中删除的
我是一名优秀的程序员,十分优秀!