Jquery代码要解决的问题
Jquery Code Sinppets to Solve
谁能告诉我这些可能的解决办法是什么?
问题 1:作为表单的网页,其 ID 为"my_form"和一些应用了类"排除"的元素。 如何制作表单的副本并仅从表单的新副本中删除具有排除类的所有元素?
问题 2:检查此代码片段。你认为它应该做什么?为什么不起作用?你会如何解决它?
$("li").each(function () {
if ($(this).find("ul")) {
$(this).css("background-color", "gray");
} else {
$(this).css("background-color", "white");
}
});
问题 3:用户抱怨即使在点击播放/暂停按钮后仍在播放音频。鉴于以下实现,为什么会发生这种情况?你会如何解决它?
// Pause Button Implementation:
$("#togglePlayPause").on("click", function () {
if (audio.paused === true) {
audio.play();
} else {
audio.pause();
}
});
// when the current audio has played all the way through, read the next element.
audio.addEventListener("ended", function () {
if (audio.paused === false) {
var nextElement = _getNextElement();
// scroll the page so that the next element we're reading is at the top of the browser window.
$(window).animate(scrollTop: nextElement.offset().top, 400, function () {
_playElementAudio(nextElement);
});
}
});
任何帮助将不胜感激。
问题 1
$("#form").not(".excluded").clone().appendTo("#anotherForm");
相关文章:
- 如何解决Yii中的页面刷新问题
- 简单的ES6承诺问题-交换解决和拒绝参数
- 为什么不'我的窗口滚动事件根本没有启动.其他答案没有解决问题
- jQuery通过步骤的自排队循环来解决延迟问题
- 我该如何解决这个问题?“未捕获的类型错误:无法读取 null 的属性'appendChild'”
- MathJax正在复制我的方程式——为什么以及如何解决这个问题
- JS驱动的常见问题页面的推荐DB解决方案
- 如何解决youtube播放器没有显示全宽的问题&身高
- 我该如何解决这个问题;参考网格”;在JavaScript中完成的对象数
- 在我的案例中,如何解决我的承诺问题
- 解决从 1.0.5 升级到 angularjs 1.3 时出现的问题
- Google 日历 API V3 会解决与会者和创建者 Java 脚本问题
- 如何在窗体中使用多个按钮解决验证问题
- 当服务器从 http 更改为 https 时,有哪些可能的方法可以解决问题
- .attr(“href”) 的问题!解决此问题的简单方法
- 你能帮忙解决这个逻辑问题吗?
- 如何在 JavaScript for D3.js 中解决这样的范围问题
- TypeError:$(..).higharts不是函数-现有解决方案不起作用-Yeoman生成器存在问题
- 投票系统大拇指向上和向下的问题解决
- Iframe滚动问题.解决方案是什么