【发布时间】:2015-08-15 14:57:06
【问题描述】:
我正在尝试为我的作品集制作照片库。我碰壁了,不知道为什么这不起作用:
这是一个按钮,可根据您当前的 URL 将您发送到一个 URL。
在本例中,用户位于“/project1.html”,单击下一步按钮,将被定向到“/project2.html”
<button class="next"><img src="images/next.png" class="next-prev-button" alt="Next"></button>
^^^ html 中的按钮
<script>
var projectnumber = 1;
$( ".next" ).click(function() {
projectnumber = projectnumber + 1;
window.location = "project" + projectnumber + ".html";
)};
</script>
当我点击按钮时,什么也没有发生。
【问题讨论】:
-
你的结束脚本错了,改成});
标签: jquery variables url redirect button