Jump to content

JS Positioning Problem


N1CK3RS0N

Recommended Posts

Hello,

 

I'm having some trouble getting the positioning of this JS to work.

 

if ((this.id == "forecolor") || (this.id == "hilitecolor")) {
    parent.command = this.id;
    buttonElement = document.getElementById(this.id);
    document.getElementById("colorpalette").style.left = getOffsetLeft(buttonElement);
    document.getElementById("colorpalette").style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight;
    document.getElementById("colorpalette").style.visibility="visible";
  }

 

The problem is when I declare a doctype for the HTML page. For some reason the positioning stops working.

 

It positions an iframe on the button that was clicked. Ideas?

Link to comment
https://forums.phpfreaks.com/topic/205879-js-positioning-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.