Codeinwp / Ideal-Image-Slider-JS

Quite simply the ideal Image Slider in vanilla JS.
http://idealimageslider.com
GNU General Public License v3.0
1.57k stars 160 forks source link

height didn't set properly #46

Closed crossRT closed 8 years ago

crossRT commented 9 years ago

As suggest, i didn't pass a height value to object constructor in order to let CSS handle the style. But it doesn't work, Ideal-Image-Slider override the slider style directly to the element. Any help will be appreciated. js:

<script>
    var slider = new IdealImageSlider.Slider({
        selector: '#slider',
        interval: 3500,
        keyboardNav: true,
    });
    slider.addBulletNav();
    slider.start();
</script>

css:

 #slider {
    height: 90%;
 }
antonioj1015 commented 9 years ago

The slider only accepts a height in px, so height: 100%; won't work, I also posted on this matter because I'm using bootstrap so I need a slider that adjusts itself to its content: https://github.com/gilbitron/Ideal-Image-Slider/issues/47

Noise859 commented 9 years ago

You need to use px or em to change the slider height

On Wed, Dec 3, 2014 at 8:05 AM, Rui Tai Low notifications@github.com wrote:

As suggest, i didn't pass a height value to object constructor in order to let CSS handle the style. But it doesn't work, Ideal-Image-Slider override the slider style directly to the element. Any help will be appreciated. js:

css:

slider {

height: 90%;

}

— Reply to this email directly or view it on GitHub https://github.com/gilbitron/Ideal-Image-Slider/issues/46.

crossRT commented 9 years ago

@KingOfAwesome i tried all the units (px and em), but still not work. It will get override by the element style.

Noise859 commented 9 years ago

I'm sorry then, I don't know what to do. Are you using GitHub Shell or a different program for the image slider?

On Mon, Dec 8, 2014 at 5:04 AM, Rui Tai Low notifications@github.com wrote:

@KingOfAwesome https://github.com/KingOfAwesome i tried all the units (px and em), but still not work. It will get override by the element style.

— Reply to this email directly or view it on GitHub https://github.com/gilbitron/Ideal-Image-Slider/issues/46#issuecomment-66101793 .

kristoforsalmin commented 9 years ago

@crossRT just pass height: false in options.

// Set height
if(this.settings.height){
    this._attributes.container.style.height = this.settings.height +'px';
}
gilbitron commented 8 years ago

Height is now responsive in v1.5.0.