Stylize Your Digg Count
By Leon Chevalier2008-04-22
Which links get a digg count?
We don’t want to give every link on the page a digg count, so the script has a few options that decide which links should be digg-count-ified. Here are the options:
- link_css: The script will only apply counts for links targeted by a CSS selector. So if you wanted all links in bulletted lists you could add the option link_css:’ul’. Or if you wanted all links in a div with the ID ‘digg’ you could supply the option link_css:’div#digg’.
- link_scope: This can be set to internal if you only want the count applied to links from your own domain.
- link_rel: If set, this will mean the digg count is applied only to links with a certain rel type. So for example you could add rel=”digg” to all links that you would like to have a digg count.
What about style options ?
Style hasn’t been forgotten, there are a few options here too:
- opacity: The initial transparency of the count box (default:60)
- pad_links: The count box can create a space for itself after the link, or it can appear ontop of the text arround it. (default:false)
- box_type: This can be set to image_only if you would like just the thumbs up box. (default:image and text)
So to create the second example above the following JavaScript is used:
new diggQuery({opacity:50,link_css:’p.digg_para’,box_type:’image_only’,pad_links:true});
Tutorial Pages:
» What’s a digg count?
» The Example
» The Digg API
» A PHP Example
» A class to query the API
» An AJAX Example
» Which links get a digg count?
» Starting the digg count
» Downloads
