Front-End & Daily

[bxSlider] Sample of the "adaptiveHeight" option to make the slider height variable for each slide

[bxSlider] Sample of the 'adaptiveHeight' option to make the slider height variable for each slide

Here's a sample of the 'adaptiveHeight' option for the jQuery slider plugin "bxSlider", which adjusts the slider's height to the current slide when image sizes (heights) are inconsistent.

We introduce how to equalize inconsistent slide heights here.

Sample

We have prepared images with varying heights.

You will notice that the slider's height changes to match the height of the current slide.

HTML

We will create a very standard bxSlider.

<div class="bxslider">
	<div class="slide"><img src="img/img01.jpg"></div>
	<div class="slide"><img src="img/img02.jpg"></div>
	<div class="slide"><img src="img/img03.jpg"></div>
	<div class="slide"><img src="img/img04.jpg"></div>
</div>

JS

The JS looks like this.

$('.bxslider').bxSlider({
	auto: true, /* optional */
	adaptiveHeight: true
});

You can set this by adding "adaptiveHeight: true" on the 3rd line.

Comments

We also welcome reports such as "It worked!"

After reviewing the content, we will publish it, omitting any personal information.

Enter your name and email address

Please enter if you would like a reply via email.

We will not disclose any personal information provided. It will only be used for replies.

It will be sent directly. Please confirm and click "Send".

If this was helpful, we appreciate your support!
All support received will go toward my child’s upbringing.

Author's My Baby List (Amazon)

Send support via OFUSE

Or support me by buying something from the buttons below
(You don't have to buy the specific item on the linked page.)

Support me via Amazon

Support me via Rakuten

Support me via Yahoo!Shopping

PR

As an Amazon Associate, Ken earns from qualifying purchases.

Share

Share on Twitter Share on Facebook Share on LINE Share on Hatena Bookmark