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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:33:50+00:00 2026-06-10T08:33:50+00:00

This is bugging me. I’m getting the absurd value of -32567 for offset().left on

  • 0

This is bugging me.

I’m getting the absurd value of -32567 for offset().left on an element with nothing more that 200 margin. offset().top works fine.

The code:

(function( $ ) {

$.fn.draw = function( options ) {


    var settings = $.extend( {
        'width'  : null,
        'height' : null,
        'color' : '#000'
}, options);

return this.each(function() {        
    var o = settings;
    var obj = $(this);
    var offset = $(obj).offset();
    var c = o.color;
    var w = o.width;
    var h = o.height;
    var i = 0;
    var t, l = 0;

  $(obj).css('overflow','hidden');
   $(obj).css('position','relative');

  if(w != null){
      $(obj).css('width',w);
  }

  if(o.height != null ){
      $(obj).css('height',h);
  }




  $(obj).mousemove(function(e){
        var $mark = $('<div class="mark" id="mark'+i+'"/>');

        l = (e.pageX) - (offset.left);
        t = (e.pageY) - offset.top;
        $(this).append($mark);
        $("#mark"+i).css({
            'position' : 'absolute',
            'top' : t,
            'left' : l,
            'width' : '3px',
            'height' : '3px',
            'background' : c    
        });

        i++;
         }); 

});

};

})( jQuery );

I was making a fun little plug that would turn any block element into a drawing pad. It worked when I was just using the mouse position on the entire page with the box located at 0,0.

Now that I’m trying to allow it to be anywhere on the browser is where the problem arises.

You can find it (not working) at: http://hangerdev.com/zacksplayground/

Sorry if I’m incoherent. I should sleep.

  • 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-10T08:33:51+00:00Added an answer on June 10, 2026 at 8:33 am

    Missing $(document).ready() likely, typing $(“#box”).offset().left in console returns 200 for me, even though the alert says -32k.

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

Sidebar

Related Questions

This is bugging me ... I have a simple HTML page that has a
This has been bugging me for more than two days now, so i thought
I have an issue that's been bugging me this morning. I'm building an ASP.NET
This has been bugging me for a while. I have this ircbot that I
This has been bugging me for a while and I'm hoping that one of
this problem is bugging me: HttpURLConnection con = (HttpURLConnection)new URL(url).openConnection(); con.setRequestMethod(HEAD); if (con.getResponseCode()!=200 ){dosomething()}
This has been bugging me for days. It's left me with a bad impression
This thing is bugging me a lot. I'm getting Parse error: syntax error, unexpected
Usually I'm good with this type of thing, but this is bugging me. I
So this has been bugging me for some time and I can't seem to

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.