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 7076845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:20:53+00:00 2026-05-28T06:20:53+00:00

Working demo CLick $(document).ready(function(e) { $(‘span#pijlr, span#pijll’).show(); $(‘#gallery’).css(‘overflow’,’hidden’); $(‘span#pijlr’).click(function(e) { if (!$(‘#gallcont’).is(‘:animated’)) { var

  • 0

Working demo CLick

$(document).ready(function(e) { 
$('span#pijlr, span#pijll').show();
$('#gallery').css('overflow','hidden');
$('span#pijlr').click(function(e) {
  if (!$('#gallcont').is(':animated')) {
    var slide = 490;
    var variable = $('#gallcont').css('left');
    var urechts = "-980px";
    if(variable > urechts) {
      $('#gallcont').animate({'left': '-=' +slide+ 'px'},'fast','linear');
    }
  }
});
$('span#pijll').click(function(e) {
  if (!$('#gallcont').is(':animated')) {
    var slide = 490;
    var variable = $('#gallcont').css('left');
    var ulinks = "0";
    if(variable < ulinks) {
      $('#gallcont').animate({'left': '+=' +slide+ 'px'},'fast','linear');
    }
  }
});
});

The problem is with the next button (span#pijlr). If i click once it wil do it’s think, and will go too -490px but when i click again it doesn’t do anything. I tried tweaking the variable urechts, but when i increase the number say about -1000px it wil work except that it go’s beyond it’s limits.

  • 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-28T06:20:54+00:00Added an answer on May 28, 2026 at 6:20 am

    This is your problem:

    if(variable > urechts) {

    variable and urechts are strings, you cannot compare them numerically.

    Change the line(s) to something like this, using parseInt to get the numerical value:

    if(parseInt(variable) > parseInt(urechts)) {

    You could also change urechts/ulinks to be integers and only do parseInt once:

    var urechts = "-980px";
    if(parseInt(variable) > urechts) { ... }
    

    Fixed example: http://jsfiddle.net/jtbowden/sVqNq/5/

    Edit: It was pointed out that this doesn’t work in Chrome. This is because Chrome returns “auto” as the left() value the first time it is called if it wasn’t explicitly defined. Simply add left: 0px to the css for .pol. Otherwise, you need to check for “auto” in your code.

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

Sidebar

Related Questions

Currently I have the below jQuery which uses the colorbox plugin http://colorpowered.com/colorbox/ $(document).ready(function(){ $(.altbgcolor).hover(function()
Why isn't this script working? $(function() { var isbn = $('input').val(); $('button').click(function() { $(#data).html('<iframe
<html> <head> <script type=text/javascript> function changepic() { document.getElementById(demo).style.top=2000; } </script> </head> <body> <h1>My First
I'm working on a demo that makes use of Spring.NET IoC capability in ASP.NET
I was working on a demo method and found something strange(at least to me
I'm working with a demo of two sortable jquery lists... but have a problem
I'm working on a demo about collision detection. (Some of the code for this
Current demo here: http://www.studioimbrue.com/sites/eliotdudik I have the tabs system working wonderfully. I'm trying to
I'm working on a simple demo project so that I can learn some things
I'm tweaking a gallery plugin for a site that I'm working on, so that

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.