Besttoolbars Development network

Back to Besttoolbars main site

 

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
How to add HTML (like a <div>) to the current webpage

 
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions
Author Message
Webmaster



Joined: 29 Aug 2006
Posts: 48

PostPosted: Tue Aug 29, 2006 9:04 am    Post subject: How to add HTML (like a <div>) to the current webpage Reply with quote

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

PostPosted: Tue Aug 29, 2006 10:13 am    Post subject: Reply with quote

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

PostPosted: Tue Sep 26, 2006 1:56 pm    Post subject: how do you close that new div tag? Reply with quote

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

PostPosted: Wed Oct 11, 2006 8:09 pm    Post subject: Re: how do you close that new div tag? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group

Copyright c Softomate, 2010. All Rights Reserved
Terms of Service | Privacy Policy