Why Circular Content Carousel jQuery plugin does not work with Bootstrap 3

試著忘記壹切 提交于 2019-12-22 13:54:45

问题


I have been trying to add a jquery carousel to my website which is nearly completely based on bootstrap 3. the problem is that the carousel which I added is not working. All the slides in the carousel are appearing at the same time and are overflowing onto other items in the website. I have attached all the necessary js and css files.

I have used circular content carousel


回答1:


Circular content carousel uses .live() as an event attachment, which is deprecated since jQuery 1.7.

Bootstrap 3 requires jQuery in version 1.9 (or higher) which uses .on() for event delegation instead of .live().

The problem is with these lines of the plugin code:

// click to open the item(s)
$el.find('a.ca-more').live('click.contentcarousel', function( event ) {
    //...
});

// click to close the item(s)
$el.find('a.ca-close').live('click.contentcarousel', function( event ) {
    //...
});

To get it work with boostrap 3 (jQuery >= 1.9) use .on() instead:

// click to open the item(s)
$el.find('a.ca-more').on('click.contentcarousel', function( event ) {
    //...
});

// click to close the item(s)
$el.find('a.ca-close').on('click.contentcarousel', function( event ) {
    //...
});


来源:https://stackoverflow.com/questions/28924283/why-circular-content-carousel-jquery-plugin-does-not-work-with-bootstrap-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!