jssor / slider

Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap

Home Page:https://www.jssor.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$ScaleSize Does not work correctly

fasnet opened this issue · comments

Hi! I have a task. It is necessary to adapt the slider for different resolutions. Found the $ScaleSize method, but it does not work properly. The width and height change correctly from the parent block id= "jssor_1", the direct descendant, but then it works out is not true. Although lines 1 and 2 are the same. Has anyone encountered such a problem? And is there access to a non-minified script? Sorry for my English!
image

commented

The logic is correct.
As jssor slider will always keep aspect ratio, I noticed the height is still 400px after scale, some area bleed outside.
For your case, I think the $ScaleWidth is closer to your approach.

Btw, you can try the parameter maxBleeding (from 0% to 100%), it means how much allowed to bleed outside.
default value is 1 (100%).

jssor_slider_instance.$ScaleHeight(width, height, 0); //0% allowed to bleed outside, all keeps inside
jssor_slider_instance.$ScaleHeight(width, height, 1); //100% allowed to bleed outside, allows up to 100% to bleed outside