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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:06:16+00:00 2026-05-16T11:06:16+00:00

I am using this right now… if($(‘.current’).hasClass(‘odd’) && !$(‘.current’).hasClass(‘even’)) { var oddMarL = $(‘.current

  • 0

I am using this right now…

if($('.current').hasClass('odd') && !$('.current').hasClass('even')) {
                        var oddMarL = $('.current img').css('margin-left'); 
                        var oddMarL2 = $('.touch').css('margin-left'); 
                        var oddMarT = $('.touch').css('margin-top'); 

                        oddMarL.replace('px', '');
                        oddMarL2.replace('px', '');
                        oddMarT.replace('px', '');

                        Math.abs(oddMarL,oddMarL2,oddMarT);

                        oddMarL = oddMarL + oddMarL2;

                        $('#zoom').css('margin-left',oddMarL);
                        $('#zoom').css('margin-top',oddMarT);
                    }

Is there something wrong with my code or is it just not possible?

It works until I add the 2 values together or when I use math.abs. In the error console it says margin-left cannot be parsed.

I have reasons for needing it this way so please don’t recommend using a class! 🙂 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-05-16T11:06:17+00:00Added an answer on May 16, 2026 at 11:06 am

    The replace and Math.max functions don’t work the way your code seems to assume they would. They return values:

    oddMarL = oddMarL.replace('px', '');
    

    and

    oddMarL = Math.abs(parseInt(oddMarL, 10));
    

    are necessary to actually change the values. You’d have to do the same thing with the other variables.

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

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is the solution - 2nd one is needed because… May 16, 2026 at 12:32 pm
  • Editorial Team
    Editorial Team added an answer The assembly that will consume this class needs to be… May 16, 2026 at 12:32 pm
  • Editorial Team
    Editorial Team added an answer You could use subprocess module: import subprocess PIPE = subprocess.PIPE… May 16, 2026 at 12:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

well im using this script right here: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/ and I have a multiMonth plugin
I have a big project I am working on right now using Visual Studio
How do I form a multidimensional array using MySQL data? I'm using this code
I am using this JQuery Ajax Voting system guide as a rough reference but
I am making great progress on a current project, but of coarse, now I
I'm having troubles right now, I can't update a table X in DBDataContext, so
I'm not thinking too clearly right now and possibly overlooking something simple. I've been
Right now, I use a combination of Python and R for all of my
I've been struggling with this for 7 days now. Your insights will be greatly
I am creating a webpage which is using asp .net as its backend. I

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.