jquery - Caroufredsel > Center Current Item to certain margin while carousel container width is 100% -


i'm trying position current middle item in carousel in middle of 100% width. here's example image http://ww.prompt-dev.com/example.png, found hard explain plain words...

carousel width 100%. items visible 3. items width variable. scroll 1 item @ time.

here's caroufredsel setup i'm using far:

$('#carousel').caroufredsel({     width: "100%",     items: { visible: 3, minimum: 2, start: -1, width: 'variable' },     scroll: { items: 1, pauseonhover: true, duration: 1000, timeoutduration: 3000         ,onbefore: function(){             $('ul#carousel li')                 .animate({opacity:0.5}, 250);         },         onafter: function(){             $('ul#carousel li')                 .filter(':eq(1)')                 .animate({opacity:1}, 250);         }     },     auto: { play: false },     prev: { button: "#prev", key: "left" },     next: { button: "#next", key: "right" },     swipe: true }); 

and css:

#carousel_wrap {     height: 700px;     left: 0;     margin: 30px 0;     overflow: hidden;     position: relative;     width: 100%; }  ul#carousel li {     display: block;     float: left;     height: 700px;     margin: 0 7.5px;     position: relative; } 

any appreciated!

this best can.

1 - added align center , responsive true js

$('#carousel').caroufredsel({     width: "100%",     align: 'center',     responsive  : true,     items: { visible: 3, minimum: 2, start: -1},     scroll: { items: 1, pauseonhover: true, duration: 1000, timeoutduration: 3000         ,onbefore: function(){             $('ul#carousel li')                 .animate({opacity:0.5}, 250);         },         onafter: function(){             $('ul#carousel li')                 .filter(':eq(1)')                 .animate({opacity:1}, 250);         }     },     auto: { play: true },     prev: { button: "#prev", key: "left" },     next: { button: "#next", key: "right" },     swipe: true });  

2 - added on line 150 , 151 of css - text align center , overflow hidden

ul#carousel li {     display: block;     float: left;     height: 700px;     margin: 0 7.5px;     position: relative;     text-align: center;     overflow: hidden; } 

here demo link: http://jsfiddle.net/ignaciocorreia/sbt9m/


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -