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

  • Home
  • SEARCH
  • 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 9105683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:09:46+00:00 2026-06-17T02:09:46+00:00

I wrote a little sliding-script based on jQuery. To remember, which slide is currently

  • 0

I wrote a little sliding-script based on jQuery. To remember, which slide is currently active and to restore this slide on a reload, the location.hash is updated. In Chrome, this works just fine. In Opera and Firefox, the animation shows some odd behaviour. Though the CSS property is updated to the correct value, the sliding finishes between two slides. This behaviour is only present, when the location.hash property is updated.

Are there known complications when combining these two mechanisms? I cannot really imagine how they affect each other.

The relevant JavaScript code:

var currentPage = 0;
var lock = false;
var transitionTime = 500;

function changePage( direction ) {
    if( lock )
        return;

    var currIndex = currentPage;
    var nextIndex = currentPage + direction;

    var cPage = $( '#page' + currIndex );
    var nPage = $( '#page' + nextIndex );

    if( cPage.length == 0 || nPage.length == 0 )
        return;

    // Set lock
    lock = true;

    // Animate scrolling container
    var newPosition = -800 * nextIndex;
    $( '#scroller' ).animate( {
        left: newPosition
    }, transitionTime, function() {
        // Remove lock
        lock = false;
    } );

    currentPage = nextIndex;
    location.hash = 'page' + nextIndex;
}

jsFiddle Remove /show/ from address bar to access jsFiddle edit page. Navigation is done via the arrow keys.

  • 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-06-17T02:09:47+00:00Added an answer on June 17, 2026 at 2:09 am

    After testing, it seems that the wrapper div is being moved to the left a little as the scroller div is moved left. Change the position of the wrapper div to fixed and it will resolve your issue.

    div#wrapper {
        height: 220px;
        left: 50%;
        margin-left: -375px;
        margin-top: -150px;
        position: fixed;
        top: 50%;
        width: 680px;
    } 
    

    Happy Coding! Here is the example fiddle.

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

Sidebar

Related Questions

Hej guys, I wrote a little php script which access a database and simply
I wrote a little script which would prompt me for an input, save that
I wrote this little test script in Ruby (on MacOS): #!/usr/bin/ruby require 'digest/sha2' def
I wrote a little Python script wrapcl.py script which wraps our compiler binary (
So I just wrote this little script. The problem is I want the newest
I wrote this little BASH script that creates a folder,unzips Wordpress and creates a
I wrote this little script to format a timedelta object according to my needs:
I wrote a little drawing script (canvas) for this website: http://scri.ch/ When you click
I wrote a little Python script which uses an Adder plugin to mix two
I wrote a little script which prints the names of files containing problematic character

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.