|
|
| Author |
Message |
Webmaster
Joined: 29 Aug 2006
Posts: 48
|
Posted: Tue Aug 29, 2006 9:04 am Post subject: How to add HTML (like a <div>) to the current webpage |
|
|
| how to add HTML (like a <div>) to a page that the user is viewing in explorer and firefox using createElement and appendChild? |
|
| Back to top |
|
 |
Admin Site Admin
Joined: 22 Aug 2006
Posts: 1055
|
Posted: Tue Aug 29, 2006 10:13 am Post subject: |
|
|
you need to use Custom Script feature with the following function :
function Launch(tool)
{
var newDiv = MainWindow.document.createElement("<DIV id=\"peekiaddition\" style=\"position: absolute; right: 0px; top: 0px; width: 90px; padding-left: 4px; padding-bottom:1px; z-index: 102; opacity: 0.7; filter: alpha(opacity=70); font-family: arial; font-size:10pt; font-weight: normal; color: #000000; background-color: #FFDD69;\">");
newDiv.innerText="Web access";
MainWindow.document.body.insertBefore(newDiv);
} |
|
| Back to top |
|
 |
jerryodom
Joined: 22 Sep 2006
Posts: 1
|
Posted: Tue Sep 26, 2006 1:56 pm Post subject: how do you close that new div tag? |
|
|
Hi admin,
After you create that new div how do you remove it or destroy it with javascript? |
|
| Back to top |
|
 |
beckzar
Joined: 03 Sep 2006
Posts: 3
|
Posted: Wed Oct 11, 2006 8:09 pm Post subject: Re: how do you close that new div tag? |
|
|
| jerryodom wrote: | Hi admin,
After you create that new div how do you remove it or destroy it with javascript? |
Set an id on your div i.e.
| Code: |
<div id="myDiv"></div>
|
and then access that div from a Javascript:
| Code: |
var myDiv = document.getElementById("myDiv");
if(myDiv){
myDiv.style.display = "none";
}
|
/Beckzar |
|
| Back to top |
|
 |
|