Archive for the ‘Javascript / jQuery’ Category

Cross Browser Compatable Rounded Corners with CSS3 & jQuery

May 10th, 2010 by admin 0

Today (at my Day Job) I had the task of taking a PSD and slice it up ready to go into a CMS. For the first time I decided it was time to start using some css3 and html5.
Everything was running smoothly until I hit the main navigation. Each navigation item needed to have an [...]

CSS3 Pseudo-Class Selectors Emulation in Internet Explorer

March 22nd, 2010 by admin 0

Keith Clark, an independent web developer from the UK, has developed a JavaScript solution to IE’s CSS3 shortcomings in relation to CSS3 selectors. CSS3 selectors became the first W3C module to reach proposed recommendation status back in December 2009.
His ie-css3.js project (currently in beta) allows Internet Explorer, versions 5 through 8, to identify CSS3 pseudo-class [...]

Simplest way to detect Internet Explorer (and version) with Javascript

February 23rd, 2010 by admin 1

<script type="text/javascript">

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
if (ieversion>=8)
document.write("You’re using IE8 or above")
else if (ieversion>=7)
document.write("You’re using IE7.x")
else if (ieversion>=6)
document.write("You’re using IE6.x")
else if (ieversion>=5)
document.write("You’re using IE5.x")
}
else
document.write("n/a")

</script>

How to get most recent flickr uploads with jQuery and getJSON

February 21st, 2010 by admin 1

Replace the var flickrAccountID with your flickr account number.
Replace the var target with your desired location for images (Should be an unordered list <ul>).

$(document).ready(function() {
var flickrAccountID = "XXXXX"
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id="+flickrAccountID+"&format=json&jsoncallback=?", function(data) {
var target = "#latest-flickr-images [...]

Display your latest tweet with jQuery and $.getJSON

February 20th, 2010 by admin 0

$.getJSON("http://twitter.com/statuses/user_timeline/YOUR_USER_NAME_HERE.json?callback=?", function(data) {
$("#twitter").html(data[0].text);
});

Ensure you add a div / p with the id of twitter (this can be changed via $(‘#twitter’) ). You will need to replace YOUR_USER_NAME_HERE with your twitter username!