Creating a bar(using userjs) for opera
Thursday, January 12, 2006 11:18:42 AM
First of all, define a variable to the bar that is created.
For example;
var toolbar = document.createElement('div');
Then add a style to the bar you have made, make sure positioning and height/width is defined and imo its better to have it like this:
toolbar.style='position:fixed;top:0;background-color:white;border:1px dotted black;';
And for reference, its best to add an id to the bar as reference for later.
toolbar.id='newbarw00t';
And to add the html content, use innerHTML. Like this:
toolbar.innerHTML='< a href="http://my.opera.com">opera community site</ a>';
And finally, append the bar to the page!
Don't use document.body as that takes in account the current pages style. Use document.documentElement instead; like this.
document.documentElement.appendChild(toolbar);
.
