function slideSwitch() {
$("#bgvid").css("background-image", "url(/assets/images/home_page/auckland.jpg)");
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});
应该在url路径中说出我的网站名称,所以我将它添加到jquery:
function slideSwitch() {
$("#bgvid").css("background-image", "url(the_vegan_repository/assets/images/home_page/auckland.jpg)");
}
并获得:
jquery.js:6685 GET http://localhost:8888/the_vegan_repository/the_vegan_repository/assets/images/home_page/auckland.jpg 404(未找到)
如何通过将资源指向the_vegan_repository/assets/images/home_page/auckland.jpg
来查找资源?
答案 0 :(得分:1)
试试这个:
function slideSwitch() {
$("#bgvid").css("background-image", "url('/the_vegan_repository/assets/images/home_page/auckland.jpg')");
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});