更新面板刷新后Javascript dose'nt工作

时间:2016-07-11 08:17:48

标签: javascript c# asp.net updatepanel swiper

我在更新面板中使用了javascript(swiper)。

我有问题,当刷新更新面板一旦swiper不再工作

<div class="swiper-container">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <div id="swiperwrapper" runat="server" class="swiper-wrapper">
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div class="swiper-pagination">
    </div>
    <div class="swiper-button-next">
    </div>
    <div class="swiper-button-prev">
    </div>
</div>
<script src="js/swiper/swiper.min.js"></script>
<script>
    var swiper = new Swiper('.swiper-container', {
        slidesPerView: 4,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        pagination: '.swiper-pagination',
        paginationType: 'none'
    });
</script>

0 个答案:

没有答案