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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:39:01+00:00 2026-06-05T14:39:01+00:00

I am trying to add two numbers but for some reason I am not

  • 0

I am trying to add two numbers but for some reason I am not getting NaN.

Following is the sample code

function Slider(container, nav, pagination){
    this.articleWidth = this.div.width() + 20;
    this.divWidth = 960;
    this.articleMargin = 0;
    this.pageMargin = this.divWidth + this.articleMargin
}

Slider.prototype.articleTransition = function(pageNum){
    var currArticle = pageNum -1;
    this.articleMargin = currArticle * this.articleWidth;
    this.container.animate({'margin-left': -this.articleMargin});
}

Here everything works as expected. But this.pageMargin is always 0 even though this.articleMargin‘s value is changing in the articleTransition function. And when I console log this.pageMargin is says NaN. I am trying to change value of this.articleMargin‘s value, everytime it is being invoked in the function.

Here is how I am invoking the function in my HTML.

    var slider = new Slider($('div#contentSleeve'), $('a.anav'), $('ul#scroller li'));

    slider.pagination.live('click', function(){
        slider.articleTransition($(this).data('num'));
    });
  • 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-05T14:39:03+00:00Added an answer on June 5, 2026 at 2:39 pm

    I did fix this. All I had to do was to create a global variable that will store the value of both pageMargin and ArticleMargin.

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

Sidebar

Related Questions

I am trying to add two larger binary numbers (i.e. number of bits are
I'm trying to compare two numbers, and add an HTML class to the large
I'm trying to add two inputs to a QTCaptureSession in the following: mainSession =
I am trying to add two decimal values but the returned sum is pure
I'm trying to add line numbers to a JTextArea and am having some difficulties.
I'm trying to add two object that they are in the same class. In
I am trying to add two values in a byte array. This is my
We have a situation where we are trying to add two UITableViews inside a
I am trying to do this List<String> stringList = new ArrayList<String>(); stringList.add(one); stringList.add(two); stringList.add(three);
I'm trying to add some songs to a vector inside a class. One of

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.