Carousel with open image on click

不羁岁月 提交于 2019-12-11 10:33:19

问题


I need a specific carousel that have, for example, 4 visible slides from 10 and you can scroll through each of them. When you click on thumb, it opens image on top.

Below follows an image:

I used lots of sliders but did not found what i am looking for.


回答1:


You could give the container the Carousel is in a background image then use some jquery to change the background image when one of the pictures is clicked.

Surround each image with

<a href="javascript:;" id="img1"></a>

then use jquery

$('#img1').on('click', function() {
    $('#changeMe').css('background-image', 'url(bg1.jpg)');
})

finally in css

#changeMe {
    background-image: url(bg1.jpg);
    background-repeat: no-repeat;
}

edit see http://www.bootply.com/PCAYskJ3Tl for quick example



来源:https://stackoverflow.com/questions/24835391/carousel-with-open-image-on-click

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