简体   繁体   English

jQuery Jssor图像滑块宽度问题

[英]jQuery Jssor Image Slider Width Issue

I recently implemented the Jssor Image Slider which is responsive: 我最近实现了具有响应能力的Jssor Image Slider:

http://www.petcenters.com/Interior-Painting-Gallery http://www.petcenters.com/Interior-Painting-Gallery

Here is the Demo: http://www.jssor.com/demos/image-gallery.html 这是演示: http : //www.jssor.com/demos/image-gallery.html

I'm having a problem adjusting the width of this container. 我在调整此容器的宽度时遇到问题。

I have tried to change the width attribute to 1340px in several places: 我尝试在多个地方将width属性更改为1340px:

<div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 800px; height: 456px; background: #191919; overflow: hidden;">

<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 800px; height: 356px; overflow: hidden;">

I have also tried modifying within responsive JavaScript. 我也尝试在响应JavaScript中进行修改。 This caused a problem with the ExtraSmall ViewPort: 这导致ExtraSmall ViewPort出现问题:

        function ScaleSlider() {
            var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
            if (parentWidth)
                jssor_slider1.$ScaleWidth(Math.max(Math.min(parentWidth, 800), 300));
            else
                window.setTimeout(ScaleSlider, 30);
        }

I also found that some of the animation became off-centered. 我还发现某些动画偏离中心。

This is probably a very easy question, but unfortunately I don't have enough experience with CSS. 这可能是一个非常简单的问题,但是不幸的是,我对CSS没有足够的经验。

Any help would be appreciated. 任何帮助,将不胜感激。

Please replace 请更换

jssor_slider1.$ScaleWidth(Math.max(Math.min(parentWidth, 800), 300));

with

jssor_slider1.$ScaleWidth(Math.max(Math.min(parentWidth, 1340), 300));

It will scale the slider width to maximum 1340px and minimum 300px. 它将缩放滑块的宽度,最大为1340px,最小为300px。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM