1
Şerefe, her birkaç saniyede bir görüntü görüntüsü için bu kodu kullanıyorum ancak her birinin görüntü boyutunu nasıl ayarlayacağımı veya nasıl ayarlanacağını bilemiyorum. hepsini aynı yapın. peşinHer birkaç saniyede bir görüntü değişiminde görüntü boyutunun değiştirilmesi
<!DOCTYPE html>
<html>
<head>
<title>change picture</title>
<script type = "text/javascript">
function displayNextImage() {
x = (x === images.length - 1) ? 0 : x + 1;
document.getElementById("img").src = images[x];
}
function displayPreviousImage() {
x = (x <= 0) ? images.length - 1 : x - 1;
document.getElementById("img").src = images[x];
}
function startTimer() {
setInterval(displayNextImage, 3000);
}
var images = [], x = -1;
images[0] = "image1.jpg";
images[1] = "image2.jpg";
images[2] = "image3.jpg";
</script>
</head>
<body onload = "startTimer()">
<img id="img" src="startpicture.jpg"/>
<button type="button" onclick="displayPreviousImage()">Previous</button>
<button type="button" onclick="displayNextImage()">Next</button>
</body>
</html>
teşekkürler!
sen boyutlarını ayarlamak için denedim ifade ediniz% 100'e görüntünün hem
width
veheight
set sığacak şekilde uzatılır istiyorsanız Görüntüler. –