First, I set the basic carousel config on flexslider, this is the carousel in one(1) row. Please take note that you need to load the flexslider plugin on your page, you can download it here - http://www.woothemes.com/flexslider/.
$(window).load(function() {
var itemCnt = 5; // this will be the number of columns per row
var iWidth = parseFloat($('.flexslider').width() / itemCnt);
$('.flexslider').flexslider({
animation: "slide",
slideshowSpeed: 1000,
animationSpeed: 300,
animationLoop: false,
directionNav: false,
slideshow: false,
touch: true,
itemWidth: iWidth,
minItems: itemCnt,
maxItems: itemCnt
});
});
Next, is to create a function that will create 2 rows from the basic 1 row slider carousel and this will be called on start function of the slider.
function make2Rows(iWidth) {
var iHeight = parseFloat($('.flexslider .slides > li').height());
$('.alliance-list .slides > li').css('width', iWidth+'px');
$('.alliance-list .slides > li:nth-child(even)').css('margin', iHeight+'px 0px 0px -'+iWidth+'px');
}
$(window).load(function() {
var itemCnt = 5; // this will be the number of columns per row
var iWidth = parseFloat($('.flexslider').width() / itemCnt);
$('.flexslider').flexslider({
animation: "slide",
slideshowSpeed: 1000,
animationSpeed: 300,
animationLoop: false,
directionNav: false,
slideshow: false,
touch: true,
itemWidth: iWidth,
minItems: itemCnt,
maxItems: itemCnt,
start: make2Rows(iWidth)
});
});
That's it and hope this would help anyone who are using flexslider as carousel.
Hello Paul,
ReplyDeleteI have tried your approach, and I am sorry that it does not seem to work just fine: if you group the n slides in 2 rows, then you will have half the navigation steps... For example: with normal flexslider, if you count on 4 slides and "move: 1" (sliding one each time "next" button is pressed), you will b able to press it 3 times. With your approach, yes, you will get 2 rows, but if you press the "next" button 2 or 3 times, you will get an empty area as there are not more slides to show...
Have you done a workaround on this issue??
Nice job, by the way.
Yes, and that is why you need to set the directionNav to false and set manualControls so you have control over it. What I did is to set manualControls: ".flex-control-nav li a" then manually populate the control nav based on the number of slides I have.. On your example, your control nav would have 1 slide and it will look something like this..
ReplyDelete<ol class="flex-control-nav flex-control-paging">
<li class="visible"><a class="flex-active">1</a></li>
</ol>
then you need to set your directionNav to check on what is active on your manualControls as below.
$(function() {
$('.flex-next').click(function(e) {
e.preventDefault();
$('.flex-prev.flex-disabled').removeClass('flex-disabled');
$('.flexslider').flexslider('next');
if ($('.flex-control-nav li.visible a:last').hasClass('flex-active'))
$(this).addClass('flex-disabled');
});
$('.flex-prev').click(function(e) {
e.preventDefault();
$('.flex-next.flex-disabled').removeClass('flex-disabled');
$('.flexslider').flexslider('prev');
if ($('.flex-control-nav li.visible a:first').hasClass('flex-active'))
$(this).addClass('flex-disabled');
});
});
Hope this help a lot.
The script above will check whether your manual control is already on the last slide by checking if the element hasClass('flex-active'). Thanks!
DeleteI have issue on this step. I can able to see two rows. but, my some of slides are empty.
Deletedo either of you have a working example I could look at.
ReplyDeleteI do have but it's not accessible publicly and sorry I can't give you credential to get in. thanks!
Deletestrange, have 12 images and 6 column in a row, it should show 2 rows with 6 images each row but it shows all in first slide and then have empty slide next. What is it that I miss?
ReplyDeleteCan you give me the URL to your site so I can check what's missing?
DeleteHey, is your itemCnt set to 6? What are the changes you did from the post I have in here?
ReplyDeleteSame problem as all, the pagination of the carousel continue like there's no double row, so if i have 20 element with itemCnt=5 (so i have 10item per page) i see 2 page with all item and another 2 empty page
ReplyDeleteThanks paul...Its working for me..
ReplyDeletegreat to know that i was able to help. thanks!
DeleteHi
ReplyDeleteHow I can make flex-direct-nav ?
because the default arrows scroll too much.
Not sure of your question but please see below, this might help..
DeleteYes, and that is why you need to set the directionNav to false and set manualControls so you have control over it. What I did is to set manualControls: ".flex-control-nav li a" then manually populate the control nav based on the number of slides I have.. On your example, your control nav would have 1 slide and it will look something like this..
<ol class="flex-control-nav flex-control-paging">
<li class="visible"><a class="flex-active">1</a></li>
</ol>
then you need to set your directionNav to check on what is active on your manualControls as below.
$(function() {
$('.flex-next').click(function(e) {
e.preventDefault();
$('.flex-prev.flex-disabled').removeClass('flex-disabled');
$('.flexslider').flexslider('next');
if ($('.flex-control-nav li.visible a:last').hasClass('flex-active'))
$(this).addClass('flex-disabled');
});
$('.flex-prev').click(function(e) {
e.preventDefault();
$('.flex-next.flex-disabled').removeClass('flex-disabled');
$('.flexslider').flexslider('prev');
if ($('.flex-control-nav li.visible a:first').hasClass('flex-active'))
$(this).addClass('flex-disabled');
});
});
Great artical, I unfortunately had some problems printing this artcle out, The print formating looks a little screwed over, something you might want to look into. sf design agency
ReplyDeleteHey, you used to write wonderful, but the last few posts have been kinda boring… I miss your tremendous writings. Past few posts are just a little out of track! come on! iphone device template
ReplyDeleteThank you a bunch for sharing this with all folks you actually recognise what you’re speaking approximately! Bookmarked. Kindly also discuss with my website =). We will have a hyperlink change arrangement between us! ipad sketch
ReplyDeleteI am typically to running a blog and i actually admire your content. The article has really peaks my interest. I am going to bookmark your site and preserve checking for new information. cell phone hacking services
ReplyDeleteliving rooms should be decorated with style that is why i always get some living room decoration idea on the internet* cash for xmas payday loan from UnitedFinances
ReplyDeleteYou could not enter into great depth, however you presented the necessities I desired to get help me thru. Was I ever really surprised to locate your blog. Please continue on your quest. patente di guida italiana
ReplyDeleteThe Most Important information. 100% Privacy Protected!. Buy USA Passport 99% Match on Second Passport
ReplyDeleteHeya i’m for the first time here. I found this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others get now safe from UnitedFinances bad credit personal loans guaranteed approval $5,000
ReplyDeleteLa nostra specialità nella produzione di patenti di guida in Italia è organizzata e specifica in questo modoAcquista la Patente a Europea C1
ReplyDeletePatente categoria C1 a Verona senza esame
Comprare patente Categoria C1 a Napoli
Being realistic, there are many successful "commercial" print models that would have really loved to have been a high fashion editorial model, but they never had that opportunity. Once again, models are subject to other's opinions and standards that control their career's general success. There are things that models can do to increase their "editorial" skills and "look", though, but there are just some models who will never get their chance at editorial modeling even though they may be uniquely beautiful, outwardly gorgeous, or even perfectly reach the standard sizes required of editorial models. It's not easy to compete with the concept of "editorial" beauty, so your modeling career should be balanced if you strive for such a "prestigious" role. If the editorial modeling style is what you think you really want to do, you need to remember that those editorials may not pay your bills alone in itself, so that's an area where a model should be well-rounded and versatile in many other types of modeling that can help supplement their income. There usually is no time for a busy fashion editorial model to have another job because a model has to be very flexible with their time for going on bookings, go-sees, fittings, etc. Establishing a back-up savings of money even in the early stages of a modeling career is crucial to hold you over as you build your career. Celina Landari
ReplyDeleteBirds For Sale
ReplyDeleteBirds For Sale Online. Birds For Sale
Ostrich For Sale. Orders Based On The Current Market Demand In Each Country. Ostrich For Sale
Chicken For Sale. Orders Based On The Current Market Demand In Each Country. Chicken For Sale
Falcon For Sale Online. Falcon For Sale
commence flooding your current inbox as well as snail-mail box having hundreds of no interest APR credit card offers right after the holiday season https://saratogapartnership.org/
ReplyDeleteIt has been found out, that the more a person delays the treatment for his sexual problems, the more complicated they start to become. WHERE TO BUY ORAL AND INJECTABLE STEROIDS ONLINE
ReplyDelete*Spot on with this write-up, I truly think this website needs much more consideration. I’ll probably be again to read much more, thanks for that info. paragard iud removal side effects
ReplyDeletePeople visit one or more casinos to play poker and over the years, advancing technology has improved the popularity and platform of the game. Luckyland Slots Free SC
ReplyDeleteYou got a very excellent website, Glad I noticed it through yahoo. UnitedFinances most trusted 500 dollar loans
ReplyDeleteThere were countless one liners that made me chuckle or laugh. Travel From Lima To Cusco
ReplyDeleteoh i just hate the fat pads that i got, my fat pad is just genetics so i can’t do anything about it** ラブドール
ReplyDeletei love to receive birthday cards specially if they are custom built birthday cards** Premier Protein Shakes
ReplyDeletei have a brother that is autistic and we love him so much and gave all of our support on him., What is Roulette
ReplyDeleteThank you a lot for sharing this with all people you actually recognise what you are talking about! Bookmarked. Kindly also discuss with my website =). We will have a link trade arrangement between us! leganes actualidad
ReplyDeleteThis is a great blog and i want to visit this every day of the week . VICTORIA FAKE DRIVERS LICENCE
ReplyDeleteExceptional brief and this post helped me a lot. Give you thanks We looking for your details?-. send flowers Greece
ReplyDeleteTraditionally growing mushrooms inside is a faster process, however it can be done outdoors successfully too. Some folks prefer to create a "mushroom house" similar to a chicken coop, or a mini greenhouse. Mushrooms do best in a darker and cool, moist and humid environments; so a basement is often an option. But make sure it is not in a draft, a direct line of the heat (or AC) when it kicks on, or direct sunlight. Most grow best at 55 to 60 degrees F, and some species like the Enoki do well with even lower temperatures, down to about 45 degrees F. Some people even prefer to grow their mushrooms in the kitchen, in the cupboard underneath the kitchen sink. Depending on the temperatures, you really can grow mushrooms year round, and have a fresh supply for your cooking, salads and sauces.. Shafaa Macrodosing Magic Mushroom Milk Chocolate Edibles
ReplyDeleteYou made some decent points there. I looked online for that problem and found most people goes coupled with with all your website. Ac repair Las Vegas
ReplyDeleteMy friend first found your blog on Google and she referred your blog to me.,”..’ MRF Tyre Dealership
ReplyDeleteReal instructive and excellent complex body part of written content , now that’s user friendly (:. pencil packing job
ReplyDeletethe table beds which we have a year ago had already broken down, it is mostly made up of plastic,. One Pearl Bank Showroom
ReplyDeletewe love watching Dancing with the stars, the actresses and actors that joins it are nice- Sky Eden
ReplyDeleteInteresting blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog jump out. Please let me know where you got your design. With thanks Sophia Regency showflat
ReplyDeleteThe when I just read a weblog, I really hope who’s doesnt disappoint me about that one. After all, I know it was my option to read, but I personally thought youd have some thing interesting to state. All I hear is often a lot of whining about something you could fix if you ever werent too busy looking for attention. reef at king's dock
ReplyDelete