我不知道这是否允许,但我有一个两部分的问题。如何将swiper.js和swiper.min.css与Laravel集成?我使用Laravel编译JS和SASS文件。我的第二个问题是,如何在Laravel中调用"onClick“事件函数?我用的是Laravel 7.3.1。
app.js
var swiper = new Swiper('.swiper-container', {
effect: 'coverflow',
grabCursor: 'true',
centeredSlides: 'true',
slidesPerView: 'auto',
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: true,
},
pagination: {
el: '.swiper-pagination',
},
});
叶片
{{ asset('public/js/app.js') }}
{{ asset('public/css/swiper.min.css' )}}
对于问题的第二部分,我想在我的Blade/视图中调用以下函数。
function close() {
document.getElementByClassName("media-icons").style.width = "0";
document.getElementByID("hide-icon-panel").style.display = "none";
document.getElementByID("show-icon-panel").style.display = "inline-block";
}
将功能包括在我的叶片中,如下所示:
<button id="hide-icons" onclick="w3_close();"><i class="left"></i>.
</button>
我试过以上所有的方法,但似乎没有任何效果。请帮帮忙,你的帮助会很有帮助的。
发布于 2020-12-25 15:04:14
import Swiper from './swiper.min.js'
const swiper = new Swiper(...)
https://stackoverflow.com/questions/61208312
复制相似问题