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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:13:20+00:00 2026-06-09T19:13:20+00:00

i am working on an adapted version of Adam Maschek’s excellent image map tool

  • 0

i am working on an adapted version of Adam Maschek’s excellent image map tool. The new functionality i have added are left/top/width/height input boxes so that you can have pixel control over the hotspot position/size. I have got it working fine in FF and Chrome but the issue i am having is in IE 7/8 where it just will not retrieve the value of the input box on change.

Here is the function where the issue is occuring:

function gui_dimension_change(e) {

function changeAreaPos(areaNum, inputVal, cssAttrib, coordPos) {
var coordsBox = document.getElementsByClassName('img_coords')[areaNum],
    newCoordsVal = coordsBox.value.split(","),
    newWidth = "",
    newHeight = "",
    imCode = imcodeContainer.value,
    pattern = imCode.match(/\d+,\d+,\d+,\d+/g);

    myimgmap.areas[areaNum].style[cssAttrib] = inputVal;

    if (cssAttrib === "left" || cssAttrib === "top") {
        myimgmap.areas[areaNum].label.style[cssAttrib] = inputVal;
        newCoordsVal[coordPos] = inputVal;
    } else if (cssAttrib === "width") {
        myimgmap.areas[areaNum].width = inputVal;
        newWidth = parseInt(newCoordsVal[0]) + parseInt(inputVal);
        newCoordsVal[coordPos] = newWidth;
    } else if (cssAttrib === "height") {
        myimgmap.areas[areaNum].height = inputVal;
        newHeight = parseInt(newCoordsVal[1]) + parseInt(inputVal);
        newCoordsVal[coordPos] = newHeight;
    }

    newCoordsVal = newCoordsVal.join(",");
    myimgmap.areas[areaNum].lastInput = newCoordsVal;
    coordsBox.value = newCoordsVal;

    imCode = imCode.replace(pattern[areaNum], newCoordsVal);
    imcodeContainer.value = imCode;

};

    // alert(this);
    // alert(this.parentNode);
    // alert(this.parentNode.id);

var inputParent = this.parentNode,
    inputVal = this.value,
    whichBox = this.name,
    areaNum = inputParent.id.replace("img_area_", ""),
    imcodeContainer = document.getElementById('html_container');

switch(whichBox)
{
    case "img_left":
        changeAreaPos(areaNum, inputVal, "left", 0);
    break;
    case "img_top":
        changeAreaPos(areaNum, inputVal, "top", 1);
    break;
    case "img_width":
        changeAreaPos(areaNum, inputVal, "width", 2);
    break;
    case "img_height":
        changeAreaPos(areaNum, inputVal, "height", 3);
    break;
}

}

The function is called like so:

myimgmap.addEvent(props[id].getElementsByTagName('input')[5], 'change', gui_dimension_change);
myimgmap.addEvent(props[id].getElementsByTagName('input')[6], 'change', gui_dimension_change);
myimgmap.addEvent(props[id].getElementsByTagName('input')[7], 'change', gui_dimension_change);
myimgmap.addEvent(props[id].getElementsByTagName('input')[8], 'change', gui_dimension_change);

So on the change event i can’t set inputParent with this.parentNode, and can’t grab the value of the input box with this.value either. Works in FF/Chrome but not IE 7/8, any ideas why IE has a problem with parentNode and getting the value?

  • 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-09T19:13:21+00:00Added an answer on June 9, 2026 at 7:13 pm

    OK, i figured out the solution in case anyone cares. It was all because IE handles event targets differently to other browsers, so i did the following:

    var obj = (myimgmap.isMSIE) ? window.event.srcElement : e.currentTarget;
    

    and used obj instead of this.

    Stupid IE!!!

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

Sidebar

Related Questions

Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
I am working on designing an Android application, and I have several questions I
Alright so i have been working on this Dynamic load of a spinner from
I have a project I am working on and it requires drill down UITableView.
I m new to ruby on rails , was working on this simple application.
I am working on an SDK. As I release new versions I would like
I have a ListView that has one image and two lines of texts for
I'm working on a application which supports several languages and has a functionality in
I am currently working on a project in which I have to keep track
I finished the English version of my application and now I am working on

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.