Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.jcarousel').on('jcarousel:create jcarousel:reload', function() {
- var element = $(this),
- width = element.innerWidth();
- alert(width);
- // This shows 1 item at a time.
- // Divide `width` to the number of items you want to display,
- // eg. `width = width / 3` to display 3 items at a time.
- element.jcarousel('items').css('width', width + 'px');
- }).jcarousel({
- });
- $('.jcarousel-control-prev').jcarouselControl({
- target: '-=1'
- });
- $('.jcarousel-control-next').jcarouselControl({
- target: '+=1'
- });
- /** Carousel **/
- .jcarousel {
- position: relative;
- overflow: hidden;
- width: 100%;
- }
- .jcarousel ul {
- width: 20000em;
- position: relative;
- list-style: none;
- margin: 0;
- padding: 0;
- }
- .jcarousel li {
- width: 800px;
- float: left;
- border: 1px solid #fff;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- }
- .jcarousel img {
- display: block;
- max-width: 100%;
- height: auto !important;
- }
- <div class="jcarousel" data-jcarousel="true">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement