Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3606828
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:17:54+00:00 2026-05-18T21:17:54+00:00

I have this form Im creating and when you click on the Next button

  • 0

I have this form Im creating and when you click on the “Next” button I want to slide the next form() across to the left this is my function

jQuery('input[name^=Next]').click(function () {
     current.animate({ marginLeft: -current.width() }, 750);
     current = current.next();
});

That function isn’t working the way I want to. it slides the text in the container across not the whole container it could be a css problem for all I know.
And my form which has a class name .wikiform doesn’t center horizontally. here is my full code. I’m not that experience in javascript so you would be appreciated. cut and paste and try it out

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript" language="javascript" src="Scripts/jquery-1.4.4.js"></script>
<script type="text/javascript" language="javascript" src="Scripts/jquery-easing.1.2.pack.js"></script>    <script type="text/javascript" language="javascript">

    (function ($) {
        $.fn.WikiForm = function (options) {

            this.Mode = options.mode || 'CancelOk' || 'Ok' || 'Wizard';
            var current = jQuery('.wikiform .view :first');
            function positionForm() {
                //jQuery('.wikiform').css( {'top':
                jQuery('body')
                    .css('overflow-y', 'hidden');
                jQuery('<div id="overlay"></div>')
                    .insertBefore('.wikiform')
                    .css('top', jQuery(document).scrollTop())
                    .animate({ 'opacity': '0.8' }, 'slow');
                jQuery('.wikiform')
                    .css('height', jQuery('.wikiform .wizard .view:first').height() + jQuery('.wikiform .navigation').height())
                    .css('top', window.screen.availHeight / 2 - jQuery('.wikiform').height() / 2)
                    .css('width', jQuery('.wikiform .wizard .view:first').width())
                    .css('left', -jQuery('.wikiform').width())
                    .animate({ marginLeft: jQuery(document).width() / 2 + jQuery('.wikiform').width() / 2 }, 750);
                jQuery('.wikiform .wizard')
                    .css('overflow', 'hidden')
                    .css('height', jQuery('.wikiform .wizard .view:first').height() );

            }
            if (this.Mode == "Wizard") {
                return this.each(function () {

                    var current = jQuery('.wizard .view :first');
                    var form = jQuery(this);

                    positionForm();

                    jQuery('input[name^=Next]').click(function () {
                        current.animate({ marginLeft: -current.width() }, 750);
                        current = current.next();
                    });
                    jQuery('input[name^=Back]').click(function () {
                        alert("Back");
                    });

                });
            } else if (this.Mode == "CancelOk") {
                return this.each(function () {

                });
            } else {
                return this.each(function () {

                });
            }
        };
    })(jQuery);

    $(document).ready(function () {
        jQuery(window).bind("load", function () {
            jQuery(".wikiform").WikiForm({ mode: 'Wizard', speed:750, ease:"expoinout" });
        });
    });
</script>
<style type="text/css">
    body 
    {
        margin:0px;
    }
    #overlay 
    {
        background-color:Black; position:absolute; top:0; left:0; height:100%; width:100%;
    }
    .wikiform 
    {            
        background-color:Green; position:absolute;
    }
    .wikiform .wizard
    {
        clear: both;
    }
    .wizard
    {
        position: relative;
    left: 0; top: 0;
    width: 100%;
    list-style-type: none;

    }
    .wizard .view
    {            
        float:left;
    }
    .view .form
    {

    }        
    .navigation 
    {
        float:right; clear:left
    }
    #view1 
    {
        background-color:Aqua;
        width:300px;
        height:300px;

    }
    #view2
    {
        background-color:Fuchsia;
        width:300px;
        height:300px;           
    }
</style>
<title></title>
</head>
<body><form action="" method=""><div id="layout">
    <div id="header">
        Header
    </div>
    <div id="content" style="height:2000px">
        Content
    </div>
    <div id="footer">
        Footer
    </div>
</div>
<div id="formView1" class="wikiform">
    <div class="wizard">    
        <div id="view1" class="view">
            <div class="form">
                Content 1
            </div>        
        </div>
        <div id="view2" class="view">
            <div class="form">
                Content 2
            </div>        
        </div>             
    </div>
    <div class="navigation">
        <input type="button" name="Back" value=" Back " />
        <input type="button" name="Next " class="Next" value=" Next " />
        <input type="button" name="Cancel" value="Cancel" />
    </div>   
</div></form></body></html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:17:55+00:00Added an answer on May 18, 2026 at 9:17 pm

    Try changing this line:

    var current = jQuery('.wizard .view :first');
    

    (which was selecting the form element directly under ‘view’)

    to this:

    var current = jQuery('.wizard .view:first');
    // The first element with a class of 'view' under an element with a class of
    // 'wizard'
    

    Update, due to comments below:

    To make a simple scrolling widget, you need the following:

    1. An outer <div> with a fixed width and height
    2. An inner <div> with a fixed height and a very long width.
    3. Code to change the left offset of the inner <div>.

    You can see a simple example of a widget like this here: http://jsfiddle.net/andrewwhitaker/feJxu/

    For the OP’s specific problem, I’ve modified the code that assigns CSS properties to look like this:

        $('.wikiform')
            .css('height', $('.wikiform .wizard .view:first').height() + $('.wikiform .navigation').height())
            .css('top', window.screen.availHeight / 2 - $('.wikiform').height() / 2)
            .css('width', $('.wikiform .wizard .view:first').width())
            .css('left', -$('.wikiform').width())
            .css('overflow', 'hidden') // ADDED
            .animate({marginLeft: $(document).width() / 2 + $('.wikiform').width() / 2
            }, 750);
    
            $('.wikiform .wizard')
                .css('width', '10000px') // ADDED.  May need to be longer depending on content.
                .css('height', $('.wikiform .wizard .view:first').height());
    

    I’ve also changed the animation that ‘next’ does:

    $('input[name^=Next]').click(function() {
        $(".wizard").animate({
            left: "-=" + current.width() + "px"
        }, 750);
    }); // Similar logic for 'back'
    

    What this is doing is basically altering the left offset of the view with a huge width (.wizard) and scrolling a new form into the view with a fixed width and height (.wikiform). See a working sample here: http://jsfiddle.net/andrewwhitaker/J9L8s/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this input in a form: <input type=text value=<script src='/js/script.js' type='text/javascript'></script> name=embed/> The
I have a form like this: <form name=mine> <input type=text name=one> <input type=text name=two>
I have this form: <form name=customize> Only show results within <select name=distance id=slct_distance> <option>25</option>
I have this little script to toggle a contact form when a button is
In Kohana/CodeIgniter, I can have a URL in this form: http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ... And then
I have this form in my view: <!-- Bug (extra 'i') right here-----------v -->
Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
I have data in this form, Article ID Company A Company B Company C
Events are synchronous in C#. I have this application where my main form starts
I have a table for a contact form and this table contains another table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.