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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:55:41+00:00 2026-06-13T16:55:41+00:00

I have spent last 2 days working on a front page to a new

  • 0

I have spent last 2 days working on a front page to a new website but these one functionality I cant get to work.

It’s probably best to view this link.

http://isca01.bigwavemedia.info/~stagedgo/html/

When you hover on promotions the page pushes 20px to the left, but when the slider is pushed clicked, when you hover over it again it should push 20 px to the right.

I used the code bellow, the way it works it checks if the wrapper has been pushed.

if ($('.wrapper').css('marginLeft') ==  "0px") {
          //code to push page left 20
     }
 if ($('.wrapper').css('marginLeft') >  "1px") {
          //code to push page right 20
     }

Any help would be amazing, thanks.

  • 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-13T16:55:42+00:00Added an answer on June 13, 2026 at 4:55 pm

    You can’t use the “more than” operator on something that is not a number.

    Try this:

    if ($('.wrapper').css('marginLeft') ==  "0px") {
          //code to push page left 20
    } else {
          //code to push page right 20
    }
    

    Alternatively, you can just pass the numbers without “px” to compare:

    if (parseInt($('.wrapper').css('marginLeft')) ==  0) {
          //code to push page left 20
    }
    if (parseInt($('.wrapper').css('marginLeft')) >=  20) {
          //code to push page right 20
    }
    

    Edit:

    Replace your whole hovering code (from line 200 to line 243) with this. Basically, move it minus to the right when margin is 0, and minus to the left when the margin is not 0. This should solve your problem.

    $(".show_hide").hover(function() {
    
        if(parseInt($(".wrapper").css('marginLeft')) == 0) {
    
            $(".wrapper").animate({
                right: -20,
                opacity: 1
            }, 300);
    
        } else {
    
            $(".wrapper").animate({
                left: -20,
                opacity: 1
            }, 300);
    
        };  
    
    }, function() {
    
        $(".wrapper").animate({
            right: 0,
            left: 0,
            opacity: 1
        }, 300);
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent last 3 days until I got gps working on android using
I have spent the last few days trying to parse a SOAP response but
Okay I have spent the last 2 days trying to sort this one out.
I have spent the last couple of days to use Core Plot for the
I've spent the last few days banging my head and searching Google and have
I have spent the last several years fighting tooth and nail to avoid working
I have spent the last few days attempting to integrate a Grails (version 1.3.2)
I have spent the last 2 days trying to find out how to do
I've spent the last 2 days trying to figure this out, basically I have
I've spent the last two days trying to get some bloody data to export

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.