Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery imageflow滑块调整大小时的图像宽度和大小_Jquery_Html_Css_Imageflow - Fatal编程技术网

Jquery imageflow滑块调整大小时的图像宽度和大小

Jquery imageflow滑块调整大小时的图像宽度和大小,jquery,html,css,imageflow,Jquery,Html,Css,Imageflow,我使用的是imageFlow,当我调整窗口大小时,较小的图像会变得非常小,因为它们是按计算方式显示的。我试图改变但没有成功,有什么建议吗 this.refresh = function() { /* Cache global variables */ this.imagesDivWidth = my.imagesDiv.offsetWidth+my.imagesDiv.offsetLeft; this.maxHeight = Math.round(my.imagesDiv

我使用的是imageFlow,当我调整窗口大小时,较小的图像会变得非常小,因为它们是按计算方式显示的。我试图改变但没有成功,有什么建议吗

this.refresh = function()
{
    /* Cache global variables */
    this.imagesDivWidth = my.imagesDiv.offsetWidth+my.imagesDiv.offsetLeft;
    this.maxHeight = Math.round(my.imagesDivWidth / my.aspectRatio);
    this.maxFocus = my.imageFocusMax * my.xStep;
    this.size = my.imagesDivWidth * 0.5;
    this.sliderWidth = my.sliderWidth * 0.5;
    this.scrollbarWidth = (my.imagesDivWidth - ( Math.round(my.sliderWidth) * 2)) * my.scrollbarP;
    this.imagesDivHeight = Math.round(my.maxHeight * my.imagesHeight);

    /* Change imageflow div properties */
    my.ImageFlowDiv.style.height = my.maxHeight + 'px';

    /* Change images div properties */
    my.imagesDiv.style.height =  my.imagesDivHeight + 'px'; 

    /* Change images div properties */
    my.navigationDiv.style.height =  (my.maxHeight - my.imagesDivHeight) + 'px'; 

    /* Change captions div properties */
    my.captionDiv.style.width = my.imagesDivWidth + 'px';
    my.captionDiv.style.paddingTop = Math.round(my.imagesDivWidth * 0.02) + 'px';

    /* Change scrollbar div properties */
    my.scrollbarDiv.style.width = my.scrollbarWidth + 'px';
    my.scrollbarDiv.style.marginTop = Math.round(my.imagesDivWidth * 0.02) + 'px';
    my.scrollbarDiv.style.marginLeft = Math.round(my.sliderWidth + ((my.imagesDivWidth - my.scrollbarWidth)/2)) + 'px';

    /* Set slider attributes */
    my.sliderDiv.style.cursor = my.sliderCursor;
    my.sliderDiv.onmousedown = function () { my.MouseDrag.start(this); return false;};

    if(my.buttons)
    {
        my.buttonPreviousDiv.onclick = function () { my.MouseWheel.handle(1); };
        my.buttonNextDiv.onclick = function () { my.MouseWheel.handle(-1); };
    }

    /* Set the reflection multiplicator */
    var multi = (my.reflections === true) ? my.reflectionP + 1 : 1;

    /* Set image attributes */
    var max = my.imagesDiv.childNodes.length;
    var i = 0;
    var image = null;
    for (var index = 0; index < max; index++)
    {
        image = my.imagesDiv.childNodes[index];
        if(image !== null && image.nodeType == 1 && image.nodeName == 'IMG')
        {
            this.indexArray[i] = index;

            /* Set image attributes to store values */
            image.url = image.getAttribute('longdesc');
            image.xPosition = (-i * my.xStep);
            image.i = i;

            /* Add width and height as attributes only once */
            if(my.firstRefresh)
            {
                if(image.getAttribute('width') !== null && image.getAttribute('height') !== null)
                {
                    image.w = image.getAttribute('width');
                    image.h = image.getAttribute('height') * multi;
                }
                else{
                    image.w = image.width;
                    image.h = image.height;
                }
            }

            /* Check source image format. Get image height minus reflection height! */
            if((image.w) > (image.h / (my.reflectionP + 1)))
            {
                /* Landscape format */
                image.pc = my.percentLandscape;
                image.pcMem = my.percentLandscape;
            }
            else
            {
                /* Portrait and square format */
                image.pc = my.percentOther;
                image.pcMem = my.percentOther;
            }

            /* Change image positioning */
            if(my.imageScaling === false)
            {
                image.style.position = 'relative';
                image.style.display = 'inline';
            }

            /* Set image cursor type */
            image.style.cursor = my.imageCursor;
            i++;
        }
    }
    this.max = my.indexArray.length;
this.refresh=function()
{
/*缓存全局变量*/
this.imagesDivWidth=my.imagesDiv.offsetWidth+my.imagesDiv.offsetLeft;
this.maxHeight=Math.round(my.imagesDivWidth/my.aspectRatio);
this.maxFocus=my.imageFocusMax*my.xStep;
this.size=my.imagesDivWidth*0.5;
this.sliderWidth=my.sliderWidth*0.5;
this.scrollbarWidth=(my.imagesDivWidth-(Math.round(my.sliderWidth)*2))*my.scrollbarP;
this.imagesDivHeight=Math.round(my.maxHeight*my.imagesHeight);
/*更改imageflow div属性*/
my.ImageFlowDiv.style.height=my.maxHeight+'px';
/*更改图像div属性*/
my.imagesDiv.style.height=my.imagesDivHeight+'px';
/*更改图像div属性*/
my.navigationDiv.style.height=(my.maxHeight-my.imagesDivHeight)+px';
/*更改标题div属性*/
my.captionDiv.style.width=my.imagesDivWidth+'px';
my.captionDiv.style.paddingTop=Math.round(my.imagesDivWidth*0.02)+px;
/*更改滚动条div属性*/
my.scrollbarDiv.style.width=my.scrollbardwidth+'px';
my.scrollbarDiv.style.marginTop=Math.round(my.imagesDivWidth*0.02)+px;
my.scrollbarDiv.style.marginLeft=Math.round(my.sliderWidth+((my.imagesDivWidth-my.scrollbarWidth)/2))+'px';
/*设置滑块属性*/
my.sliderDiv.style.cursor=my.sliderCursor;
my.sliderDiv.onmousedown=函数(){my.MouseDrag.start(this);返回false;};
如果(我的按钮)
{
my.buttonPreviousDiv.onclick=function(){my.mouseweel.handle(1);};
my.buttonNextDiv.onclick=函数(){my.mouseweel.handle(-1);};
}
/*设置反射乘法器*/
var multi=(my.reflections==true)?my.reflectionP+1:1;
/*设置图像属性*/
var max=my.imagesDiv.childNodes.length;
var i=0;
var-image=null;
对于(var指数=0;指数(image.h/(my.reflectionP+1)))
{
/*景观格式*/
image.pc=my.percentscape;
image.pcMem=my.percentscape;
}
其他的
{
/*纵向和方形格式*/
image.pc=my.other;
image.pcMem=my.percentOther;
}
/*改变图像定位*/
如果(my.imageScaling==false)
{
image.style.position='relative';
image.style.display='inline';
}
/*设置图像光标类型*/
image.style.cursor=my.imageCursor;
i++;
}
}
this.max=my.indexArray.length;

您可以在图像上设置最小宽度。例如:

img {min-width: 200px;}

你可以用CSS解决这个问题。如果你看imageflow类,它的宽度设置为100%。如果你改为固定宽度,你就可以解决你的问题。@Natalie H我不想让它固定大小……但是如果窗口的大小比图像的宽度和高度小,那就不会发生了,我想要大一点的图像