Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createButton() {
- var a = document.createElement('a');
- a.href = '#';
- a.innerHTML = 'Print Topic';
- a.style.position = 'absolute';
- a.style.right = '3em';
- a.style.top = '6em';
- a.style.fontFamily = 'Arial,Helvetica,sans-serif';
- a.style.fontWeight = 'bold';
- a.style.fontSize = '125%';
- a.style.background = '#777777 none repeat scroll 0 0';
- a.style.color = 'white';
- a.style.padding = '6px 12px';
- document.body.insertBefore(a, document.body.lastChild);
- }
- function createButton() {
- var a = document.createElement('a');
- var css = document.createElement('style');
- css.type = 'text/css';
- css.innerHTML = '#prt { position:absolute; right:3em; top: 6em; font-family: Arial,Helvetica,sans-serif; font-weight:bold; font-size:125%; background: #777777 none repeat scroll 0 0; color: white; padding: 6px 12px;}'
- a.href = '#';
- a.innerHTML = 'Print Topic';
- a.id = 'prt';
- document.body.insertBefore(a, document.body.lastChild);
- document.body.appendChild(css);
- }
- s = a.style;
- s.position = "absolute";
- ...etc...
- s.color = "white";
- $("a").css({position: "absolute", right: "3em", top: "6em"}) // etc.
- $("<a href='toto/'></a>")
- .css("position", "absolute");
- .css("right", "3em")
- .appendTo($(containerid));
- with a.style {
- position = 'absolute';
- right = '3em';
- }
- function setStyle(elem) {
- with elem.style {
- position = 'absolute';
- right = '3em';
- }
- return elem
- }
- //Invoke like this: elem = setStyle(elem)
- <style type='text/css'>
- a .prt {
- position:absolute;
- right:3em;
- top: 6em;
- font-family: Arial,Helvetica,sans-serif;
- font-weight:bold;
- font-size:125%;
- background: #777777 none repeat scroll 0 0;
- color: white; padding: 6px 12px;
- }
- </style>
- <script>
- function createButton() {
- var a = document.createElement('a');
- a.class= 'prt';
- document.body.insertBefore(a, document.body.lastChild);
- }
- </script>
Add Comment
Please, Sign In to add comment