简体   繁体   English

滑动html页面的下一个和上一个按钮

[英]sliding through html pages next and previous buttons

I am creating multi page form on 4 different pages. 我在4个不同的页面上创建多页面表单。 I want to include a next and previous button to be able to navigate through the form. 我想包括一个下一个和上一个按钮,以便能够浏览表单。 I have searched online but what i find is usually navigating <div> s on a page. 我已经在网上搜索过,但是我发现通常是在页面上导航<div> How do I change this to do my bidding? 如何更改此出价? Thank you in advance. 先感谢您。

this is the code for the previous button i found online. 这是我在网上找到的上一个按钮的代码。 .registration-form is the name of a form. .registration-form.registration-form的名称。 I want to change this to navigate through my html pages. 我想更改它以浏览我的html页面。

$('.registration-form .btn-previous').on('click', function() {
    $(this).parents('fieldset').fadeOut(400, function() {
        $(this).prev().fadeIn();
    });
});

Forms on the different pages have names part1 , part2 , part3 and part4 . 在不同的页面形式有名字part1part2part3part4 Also when a user goes to a previous page and goes back the next page, the user should see what he/she entered before pressing the previous button. 同样,当用户转到上一页并返回下一页时,用户应在按上一个按钮之前先查看他/她输入的内容。

您可以在html中创建一个链接到其他页面的按钮。

<input type="button" onclick="location.href='http://google.com';" value="Go to Google" />

A static solution for you is that you can set next previous button to every page and set the respective links on that pages 一个静态的解决方案是,您可以在每个页面上设置下一个上一个按钮,并在该页面上设置相应的链接

for eg. 例如

page1.html page1.html

<input type="button" value="Previous" onclick="window.location='page4.html'">
<input type="button" value="Next" onclick="window.location='page2.html'">

page2.html page2.html

<input type="button" value="Previous" onclick="window.location='page1.html'">
<input type="button" value="Next" onclick="window.location='page3.html'">

page3.html page3.html

<input type="button" value="Previous" onclick="window.location='page2.html'">
<input type="button" value="Next" onclick="window.location='page4.html'">

page4.html page4.html

<input type="button" value="Previous" onclick="window.location='page3.html'">
<input type="button" value="Next" onclick="window.location='page1.html'">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM