Expand|Select|Wrap|Line Numbers
- function creatediv(id, html, width, height, left, top) {
- if (document.getElementById(id) != null) {
- removediv(id);
- }
- var newdiv = document.createElement('div');
- newdiv.setAttribute('id', id);
- document.body.appendChild(newdiv);
- if (width) {
- document.getElementById(id).style.width = 300;
- }
- if (height) {
- document.getElementById(id).style.height = 300;
- }
- if ((left || top) || (left && top)) {
- document.getElementById(id).style.position = "absolute";
- if (left) {
- document.getElementById(id).style.left = left;
- }
- if (top) {
- document.getElementById(id).style.top = top;
- }
- }
- document.getElementById(id).style.background = "lightyellow";
- document.getElementById(id).style.border = "4px solid #000";
- if (html) {
- document.getElementById(id).innerHTML = html;
- } else {
- document.getElementById(id).innerHTML = "nothing";
- }
- document.getElementById(id).style.filter='alpha(opacity=75)'; // IE Semi Transparent Setting
- document.getElementById(id).style.opacity='0.75'; // FireFox Semi transparent Setting
- }
- function removediv(id) {
- var d = document.getElementById(id);
- document.body.removeChild(d);
- }