请有人帮我解决这个问题 [英] Please can someone help me out with this code
本文介绍了请有人帮我解决这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我一直坚持让我的幻灯片在我的网站上工作一段时间,并希望你的专家可以指出我正确的方向?我是一个菜鸟,当涉及到HTML,Java等等。所以请好在这里是我的代码:所以基本上它在本地工作,但一旦通过ftp上传到我的网络服务器它不?非常感谢您的帮助!
Hi everyone
i have been stuck on making my slideshow work on my website for a while now and hoping you experts can point me in the right direction? I am a noob when it comes to HTML, Java etc etc. So please be nice here is my code: So basically it works locally but once uploaded to my web server via ftp it doesn't? your help is much appreciated thanks!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="CSS/style_tut.css" rel="stylesheet" type="text/css">
<style type="text/css">
#slider{
height:450px;
width:650px;
margin: 20px auto;
position:relative;
}
#img{
height:450px;
width:650px;
position:absolute;
}
#left_holder{
height:450px;
width:100px;
position:absolute;
left:0px;
top:0px;
}
#right_holder{
height:450px;
width:100px;
position:absolute;
right:0px;
top:0px;
}
.left{
height:50px;
width:50px;
position:absolute;
top:40%;
left:0px;
}
.right{
height:50px;
width:50px;
position:absolute;
top:40%;
left:50px;
}
</style>
<script src="js/alert_tut.js">
var imagecount = 1;
var total = 5;
function slide(x) {
var Image = document.getElementById('img');
imagecount = imagecount + x;
if(imagecount > total){ imagecount = 1;}
if(imagecount < 1){ imagecount = total;}
Image.src = "images/img"+ imagecount +".jpg";
}
window.setInterval(function slideA() {
var Image = document.getElementById('img');
imagecount = imagecount + 1;
if(imagecount > total){ imagecount = 1;}
if(imagecount < 1){ imagecount = total;}
Image.src = "images/img"+ imagecount +".jpg";
},5000);
</script>
</head>
<body onLoad="slideA()">
<div id="slider">
<img src="images/img1.jpg" id="image" >
<div class="left_hold"><img ></div>
<div class="right_hold"><img ></div>
</div>
</body>
</html>
推荐答案
你有一个非常挑剔的网络服务器。文件夹结构区分大小写。在google开发工具中检查元素时,我可以看到第一个是 i mages / img1.jpg,下一个图像被加载为 I mages / imgx.jpg。
所以,这个网址是有效的, http:// www .defiximports.com / images / img2.jpg [ ^ ]
但是这个不是
http://www.defiximports.com/Images/img2.jpg [ ^ ]
愚蠢的网络服务器。我不认为IIS是区分大小写的,这非常令人讨厌,IMO。不知道你在托管什么。
所以,只需更改图片链接而不是图片。
You have a very picky webserver. The folder structure is case sensitive. When inspecting the element in google dev tools I could see that the first one was images/img1.jpg and the next images were loaded as Images/imgx.jpg.
So, this url is valid, http://www.defiximports.com/images/img2.jpg[^]
but this one is not
http://www.defiximports.com/Images/img2.jpg[^]
Silly webserver. I don't think IIS is case sensitive and that is pretty annoying, IMO. Not sure what you're hosting on.
So, just change your links to images instead of Images.
谢谢RyanDev指出我正确的方向!它归结为alert_tut.js文件需要图像更改为图像和图像正在缓存,所以我所做的是清除缓存重新上传的文件,一切都正常工作,现在再次感谢RyanDev。
Thanks to RyanDev for pointing me in the right direction! It came down to the alert_tut.js file needing "Images" changed to "images" and images being cache so what i did was clear the cache re-uploaded files and everything is working now thanks to RyanDev once again.
这篇关于请有人帮我解决这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文