Welcome to Aurora Design Studio, the online portfolio of Jason Coates
Professional graphic design and web design, Scotland
Call me on 01862 842 046

Aurora Design Studio

Aurora Design Studio Blog

Sunday 18 October 2009

Simple Cut and Past Javascript to Add Social Networking Links to Your Website

<ul id="social_networking"> <script type="text/javascript"> document.write('<li><a href='+'"http://digg.com/submit?phase=2&amp;url='+location.href+' "title="digg"><img src="digg.gif" alt ="Digg" class = "social">Digg</a></li>'); document.write('<li><a href='+'"http://del.icio.us/post?url='+location.href+' "title="Delicious"><img src="delicious.gif" alt ="Delicious" class = "social">Delicious</a></li>'); document.write('<li><a href='+'"http://reddit.com/submit?url='+location.href+' "title="Reddit"><img src="reddit.gif" alt ="Reddit" class = "social">Reddit</a></li>'); document.write('<li><a href='+'"http://www.stumbleupon.com/submit?url='+location.href+' "title="StumbleIpon"><img src="stumbleupon.gif" alt ="StumbleUpon" class = "social">StumbleUpon</a></li>'); </script> </ul>

The Javascript will insert the URL of your current page allowing you to automate this task.

All that is left to do is style up the HTML with some CSS and find some suitable images for your links.

Example Page

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home