<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><html><head> <title>欢迎来到亿丰旅游用品有限公司首页</title> <link href="style4.css" type="text/css" rel="stylesheet"> <script type="text/javascript"> window.onload = function () { var container = document.getElementById('container'); var list = document.getElementById('list'); var buttons = document.getElementById('buttons').getElementsByTagName('span'); var prev = document.getElementById('prev'); var next = document.getElementById('next'); function animate(offset){ var newLeft=parseInt(list.style.left)+offset; list.style.left=newLeft+'px'; if(newLeft>-1900){ list.style.left=-9500+'px'; } if(newLeft<-9500){ list.style.left=-1900+'px'; } } next.onclick=function(){ animate(-1900); } prev.onclick=function(){ anmimate(1900); } } </script> </head><body> <div> <div><h2>亿丰酒店旅游用品有限公司</h2> <div class="navigation ;"> <div> 注册 ┊ 登录 ┊ 帮助</div> <ul > <li ><a href="#">网站首页</a></li> <li ><a href="#">简介</a></li> <li ><a href="#">商品信息</a></li> <li ><a href="#">关于我们</a></li> <li > <a href="#">联系我们</a></li> </ul> </div> </div> </div> <div id="container"> <div id="list" style="left:-1900px;"> <img src="5.jpg" alt="5"><img src="1.jpg" alt="1"><img src="2.jpg" alt="2"><img src="3.jpg" alt="3"><img src="4.jpg" alt="4"><img src="5.jpg" alt="5"> <img src="1.jpg" alt="1"> </div> <div id="buttons"> <span index="1" ouS=""></span> <span index="2" ></span> <span index="3" ></span> <span index="4" ></span> <span index="5" ></span> </div> <a href="javascript" id="prev"><</a> <a href="javascript" id="next">></a> </div></body></html>body{ background: linear-gradient(orange, white); background-size: cover;}.navigation{ font-size: 20px; margin:0px;}.title{ position: absolute; color: black; right: 0px; top: 0px;}*{ margin: 0px; padding: 0px;}h2{ align-content: center; font-family: monospace;}.top { width: 100%; height: 70px;}.top-content{ padding: 20px ; width: 60%; height: 60px; margin: 30px auto; font-size: larger; color: gold; font-family: cursive; text-align: center; font-size: 30px;}#container{ margin-top:30px; width: 1263px; height:441px; overflow:hidden; position:relative; }#list{ position:absolute; width:8841px; height:441px; z-index:1;}#list{ float:left;}#buttons{ margin-left:600px; position:absolute; height:10px; width:100px; z-index:2; bottom: 20px; }#buttons span { cursor: pointer; float: left; border: 1px solid #fff; width: 10px; height: 10px; border-radius: 50%; background: #333; margin-right: 5px;}#buttons .on{ background:orangered}.arrow { cursor: pointer; display: none; line-height: 39px; text-align: center; font-size: 36px; font-weight: bold; width: 40px; height: 40px; position: absolute; z-index: 2; top: 180px; background-color: RGBA(0,0,0,.3);}.arrow:hover{ background-color:RGBA(0,0,0,7)}#container:hover .arrow{ display:block;}#prev { left: 20px;}#next { right:20px;}ul{ life-style-type: none;}.aclass a:link,a:visited{ text-decoration: none; width: 100px; text-align:center; fond-weight: bold;}li{ display:inline;}a:active,a:hover{ background-color: dodgerblue;}
1 回答
pardon110
TA贡献1038条经验 获得超227个赞
报错 404是因为你代码写的有问题,它执行了a链接跳转,去找入口页面下的javascript文件,
<a href="javascript" id="next">></a>
建议改成这样
<a href="javascript:;" id="next">></a>
添加回答
举报
0/150
提交
取消