gibney.org
:
Technology
:
Javascript
:
Repository
:
message_box
(Entry Nr. 89, by user 1 |
edit
)
/******************************************************************************* * Displays a simple message next to a Gibney Enterprises Logo. * Used in our Bookmarklets. * * A more customizable thingy can be found in info_box.js *******************************************************************************/ ge_require_once('http://javascript.gibney.org/view.js'); ge_require_once('http://javascript.gibney.org/dynamic_html_elements.js'); function ge_messageBox(link,message) { var messageBoxId='ge_mb_01'; var xPos=10+ge_view_getScrollX(); var yPos=10+ge_view_getScrollY(); var messageBoxHtml='<table style="background-color:#ffffff;border:1px solid #000000;color:#000000;">'; messageBoxHtml+= '<tr><td style="padding: 0.5em;"><a href="'+link+'" target=_blank><img src="http://en.gibney.org/elements/images/mg-sign.gif" style="border: 0;"></a></td>'; messageBoxHtml+= '<td style="padding: 0.5em;">'+message+'</td></tr></table>'; var messageBox=createDiv(messageBoxId,xPos,yPos,messageBoxHtml); messageBox.style.zIndex=9999; return messageBoxId; } function hideMessageBoxOnClick(e) { var messageBoxId='ge_mb_01'; if (!document.getElementById(messageBoxId)) return; // already closed if (!e) e = window.event; var tempObj = isDOM ? e.target : e.srcElement; while(tempObj.parentNode && tempObj.id!=messageBoxId) { tempObj=tempObj.parentNode; } if (tempObj.id==messageBoxId) return; // dont close the message box if you click it removeDiv(messageBoxId); }
Create a new entry at this position