Low down, image in page, want to cut a diagonal and post co-ords to server.
ISMAP is no good as it only posts a point. I want to cut a rectangle and zoom.
Soz to bug you again and some info for your memory banks.
I know its a minor point but I have tried to sort it .... at least for IE5+
If you can't be bothered then thats ok as it is such a minor point.
The functions you gave me work fine all the way up to the document.body ...
there we run into a problem as described.
Recap .. if the body has been set with a style tag, or if it has been given
assigned a class with a border width then it breaks your code
Now the function I sent you before was this ... for the style top
var ie5 = document.all != null && document.getElementsByTagName != null;
function getTopPos(el) {
if (ie5) {
if (el.currentStyle.top == "auto")
return 0;
else
return parseInt(el.currentStyle.top);
}
else {
return el.style.pixelTop;
}
}
I have modified your functions to include a Border version of the above ...
that Border version works in IE5 only (I presume) - there is a line I can't
guess at this far down in the DOM.
function getBodyBorderWidth() {
if (ie5) {
if (document.body.currentStyle.border == "auto")
return 0;
else
return parseInt(document.body.currentStyle.borderWidth);//hey hey guessed
it.
}
else {
return 0;//document.body.style.border.pixelBorderwidth???;//can't get this
one !
}
}
function _elementTop(el) {
var et = 0;
while (el) {
et += el.offsetTop;
el = el.offsetParent;
}
et += getBodyBorderWidth();
return et;
}
I do have another question. If I use ISMAP I get co-ords appended to url
(?234,857) ... this hasn't got any jscript hassles associated with it, but
can only use it on href ... which is not good if we need to play with the
co-ords client side.
I've tried href="javascript:myfunction()" but you just get the url
javascript:myfunction()?234,857
appearing in a new window.
Question :: Can we get to those co-ords client side ??? Any tricks of the
trade you could let me in on ???? I can't override the ISMAP pointing to
href, even when I capture mousevents for the whole doc.
The ISMAP seems to have put itself outside the document, like an IFrame, is
there anyway we can capture events for the ISMAP image seeing as it no
longer behavous like an image ??
(I think its an ActiveX control (a guess), built into Windows - can we get to it
?)
This javascript is too heavy, and IE based - it's a damn site easier to use an
IFrame.