/ Published in: JavaScript
URL: http://stylizedweb.com/2008/01/13/outline-text-with-js/
this would outline a string. it is up to you how to choose the string. maybe an element in html.
Expand |
Embed | Plain Text
<script> <!– var message=”outline”; var thickness=1; var color2=”black”; var color1=”white”; var extra=”font-size:40px;”; var x = -thickness; var y = -thickness; while (y<=thickness) { while (x<=thickness) { document.write (”<span style=’”+extra+” color:”+color2+”; position:absolute; left:”+x+”; top:”+(-y)+”;’>”+message+”</span>”); document.write (”<span style=’”+extra+” color:”+color2+”; position:absolute; left:”+x+”; top:0;’>”+message+”</span>”); document.write (”<span style=’”+extra+” color:”+color2+”; position:absolute; left:”+x+”; top:”+y+”;’>”+message+”</span>”); x=x+1; } y=y+1; } document.write (”<span style=’”+extra+” color:”+color1+”; position:absolute; left:0; top:0;’>”+message+”</span>”); //–> </script>
You need to login to post a comment.
