jammer1221
Programmer
Hey all,
I am having some trouble with some code I'm trying to write.
Here is a link to the page where you can see the page in action.
I am having a popup/tool tip display when you mouse over certain states. The trouble I am having is when you mouse over certain states (Ohio, Penn.,New Hampshire) they stick out well beyond 800px. My problem with that is if a person whose resolution is 800x600 views the page they won't be able to see all of the text.
So I wrote a little bit of script to calulate the total width of the DIV and if its over 750, scoot it over a little bit.
Its very hit or miss!
Here is the code in question...I have put in some window.status to kind of debug.
Feel free to view the page above and any help is very much appreciated!
P.S. My code gets a little sloppy especially when I get stuck somewhere, so please forgive me. I will try and explain the code as best I can.
I am having some trouble with some code I'm trying to write.
Here is a link to the page where you can see the page in action.
I am having a popup/tool tip display when you mouse over certain states. The trouble I am having is when you mouse over certain states (Ohio, Penn.,New Hampshire) they stick out well beyond 800px. My problem with that is if a person whose resolution is 800x600 views the page they won't be able to see all of the text.
So I wrote a little bit of script to calulate the total width of the DIV and if its over 750, scoot it over a little bit.
Its very hit or miss!
Here is the code in question...I have put in some window.status to kind of debug.
Code:
if (document.getElementById("poofer").offsetWidth+document.getElementById("poofer").offsetLeft>750) {
where=document.getElementById("poofer").offsetWidth+document.getElementById("poofer").offsetLeft
totWidth=(document.getElementById("poofer").offsetWidth+document.getElementById("poofer").offsetLeft)-750
mLeft=mLeft-totWidth;
status="width: "+document.getElementById("poofer").offsetWidth+" Left: "+document.getElementById("poofer").offsetLeft+" Total "+where+" Subtraction: "+totWidth
}else {
where=document.getElementById("poofer").offsetWidth+document.getElementById("poofer").offsetLeft
status="NOT OVER width: "+document.getElementById("poofer").offsetWidth+" Left: "+document.getElementById("poofer").offsetLeft+" Total "+where+" table calc width: "+tableWidth
}
Feel free to view the page above and any help is very much appreciated!
P.S. My code gets a little sloppy especially when I get stuck somewhere, so please forgive me. I will try and explain the code as best I can.