简体   繁体   English

我使用GIMP和mtPaint调整了大小,但是它不起作用。 幻灯片放映时图像尺寸不会改变

[英]I resized with GIMP and mtPaint, it does not work. The image size does not change when I put it slideshow

 var myIndex = 0; carousel(); function carousel() { var i; var x = document.getElementsByClassName("mySlides"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } myIndex++; if (myIndex > x.length) {myIndex = 1} x[myIndex-1].style.display = "block"; setTimeout(carousel, 2000); // Change image every 2 seconds } 
 .mySlides {display:none;} 
 <body> <h2 class="w3-center">Automatic Slideshow</h2> <div class="w3-content w3-section" style="max-width:600px"> <img class="mySlides" src="cigand1.jpeg" style="width:30%"> <img class="mySlides" src="eu1.jpeg" style="width:30%"> <img class="mySlides" src="hun1.jpg" style="width:30%"> </div> </body> 
I think the code is right, but the third image is bigger in the slideshow than I want. 我认为代码是正确的,但是幻灯片中的第三个图像比我想要的大。 I resized the image but does not work. 我调整了图像的大小,但是不起作用。 How to solve this problem? 如何解决这个问题呢? Did you meet problem like this? 你遇到这样的问题了吗? Now you can not see the pictures, the problem is other. 现在您看不到图片,问题出在其他。

I am not sure but checking your code, you are just setting a max-width to the image. 我不确定,但是请检查您的代码,您只是在设置图像的最大宽度。

<div class="w3-content w3-section" style="max-width:600px">

That means, if the picture width is less than 600px, (500px for instance) it will display a 500px width picture. 这意味着,如果图片宽度小于600像素(例如500像素),它将显示500像素宽度的图片。

You can try something like this 您可以尝试这样的事情

<div class="w3-content w3-section" style="width:600px">

But the best way to do so, is to have all the pictures with the same width. 但是最好的方法是使所有图片具有相同的宽度。

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

相关问题 通过 javascript 更改图像源似乎不起作用。 我究竟做错了什么? - Change image source through javascript does not seem to work. What am I doing wrong? Bootstrap 3 scrollspy不起作用。 当我向下滚动然后突出显示时,它不会突出显示“关于” - Bootstrap 3 scrollspy does not work. It does not highlight “About” when i scroll down then it highlighted 当我将其放在服务器上时,JavaScript无法正常工作 - JavaScript does not work when I put it on the server 更改其尺寸时,HTML幻灯片图像大小不会增加 - HTML Slideshow Image Size Does Not Increase When Changing It's Dimentions 调整浏览器大小时,图像上的文本不起作用 - Text over image does not work when browser resized 帆布-当我放 <canvas> 在div中不起作用 - Canvas - When i put <canvas> in div does not work 当我增加图像尺寸时,td尺寸不会增加 - td size does not increase when i increase the size of image 我的JQuery图片幻灯片似乎不起作用 - My JQuery image slideshow does not seem to work 获取 - 下载 Excel 文件不起作用。 文件大小 1 kb - Fetch - Download Excel File does not work. File Size 1 kb 当我将脚本放在母版页的脚本文件中时,jQuery手风琴不起作用,但是当我将其直接放在页上时,它起作用 - Jquery accordion does not work when I put the script in script file on a master page, but it does when I put it directly on the page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM