With jQuery Cycle 2 how do I show a part of the ne

2019-06-11 23:52发布

I've been struggling with this for a while now and have seen some very complex JavaScript based solutions. I finally cracked it (for my needs anyway) with a minimal CSS solution.

1条回答
Lonely孤独者°
2楼-- · 2019-06-11 23:56

Essentially you move the "overflow: hidden" from the slideshow element to a parent element that is wider, and then set a left margin on the slideshow element.

I've updated a JSFiddle for a fixed layout: http://jsfiddle.net/mledwards34/x89sQ/5/

.slideshow-container {
    overflow: hidden !important;
    width: 300px;
}

.slideshow {
    overflow: visible !important;
    margin-left: 50px;
}

and a responsive layout: http://jsfiddle.net/mledwards34/x89sQ/6/

.slideshow-container {
    overflow: hidden !important;
    width: 50%;
}

.slideshow {
    overflow: visible !important;
    width: 80%;
    margin-left: 10%;
}
查看更多
登录 后发表回答