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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:01:27+00:00 2026-05-24T18:01:27+00:00

I’m trying to manipulate a div element. Although I have defined certain property values,

  • 0

I’m trying to manipulate a div element. Although I have defined certain property values, I can’t seem to get the initial values.

Here’s the problem: Fiddle

I’m at the end of my rope… 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-24T18:01:29+00:00Added an answer on May 24, 2026 at 6:01 pm

    I think you have to use document.styleSheets, find your stylesheet, then loop through the cssRules(IE rules) list to match a selector to "#viewbase" and then you can access your style properties like you would have with inline styles, since the style info in there is also a CSSStyleDeclaration ( so you can use element.style.left and so on).

    Sidenode: getComputedStyle doesn’t work on most versions of IE. IE has currentStyle properties for each element, but it’s not the same thing. Maybe a combination of both will also work.

    UPDATE

    Managed to get the initial positions, if that’s what you need, you can reassign these values if i remember well.

    function trigger(e) {
    
    item = this;
    
    if (!e) var e = window.event;
    if (e.pageX || e.pageY) {
        x1 = e.pageX;
        y1 = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        x1 = e.clientX;
        y1 = e.clientY;
    }
    
    document.getElementById("ex").innerHTML = x1;
    document.getElementById("wye").innerHTML= y1;
    // the stylesheet you defined, in a standalone context, it might 
    // have another index, (i.e. 0 if it's the only one)
    list = document.styleSheets[2].cssRules;
    
    for(var i=0;i<list.length;i++)
        //match #viewbase
        if(list[i].selectorText.toLowerCase() == "#"+item.id)
        { item = list[i];
          break;
         }
    
    document.getElementById("xval").innerHTML = item.style.left;
    document.getElementById("yval").innerHTML = item.style.top;
    
    document.getElementById("parseX").innerHTML = parseInt(item.style.left, 10);
    document.getElementById("parseY").innerHTML = parseInt(item.style.top, 10);
    
    document.getElementById("debug").innerHTML = 'clicked!';
    
    document.onmouseup = release;
    }
    

    The other version would be to use the following

    var styleDef = window.getComputedStyle(item) || item.currentStyle;  
    document.getElementById("xval").innerHTML = styleDef.left;
    document.getElementById("yval").innerHTML = styleDef.top;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a jquery bug and I've been looking for hours now, I can't
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,

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.