如何解决将 HTML 中的列表与 swiper.js 结合
我正在使用 HTML 和 javascript 创建一个评论框,然后我想将评论列表与 swiper.js 结合起来。
当评论列表出现时,这是我的 index.html 代码:
<div class="content-block section-title">
<h2> R.S.V.P </h2>
<span>Are you <em>Attending ?</em></span>
</div>
<ul style="font-size: large;" class="list"></ul>
这是我添加评论并合并到列表时的 script.js
let add = () => {
let name = document.querySelector('.contact-form #uname');
let comment = document.querySelector('.contact-form #umessage');
if (name.value !== "" && comment.value !== "") {
let list = document.querySelector('.list');
let list_item = document.createElement("l1");
alert('Thanks for your kind wishes.')
list_item.innerHTML = `
<div style="width:80%; text-align:center; font-size:14px; margin-left:10%; margin-right:10%;">
<h3 style="text-tranform:capitalize">${name.value}
<span style="display:block; font-family:Arial,Helvetica,sans-serif; font-size:12px; margin-top:5px; text-transform: lowercase;"></span>
</h3>
<p style="font-size: 14px; margin-top: 15px;">${comment.value}</p>
</div>
</div>
`;
list.append(list_item)
/* name.value=comment.value = "";
*/
}
if (name.value == "" || comment.value == "") {
alert('cannot be empty,thanks.')
list.append(list_item);
/* name.value=comment.value = "";
*/
}
name.value = comment.value = "";
}
我只想将该评论列表与 swiper.js 结合起来,这样结果就不会变成列表,而是在幻灯片上。 那么,我需要在代码中添加什么? 我很抱歉我的英语,谢谢:)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。