Lost your password?

ZOMG! jQuery!

ZOMG I figured out some jQuery today.. so stoked, used to look sooo very very wierd to me. glad I worked it out when I did actually. Its not hard to learn, its just got wierd syntax which makes life a little bit difficult, I mean using the $ instead of jQuery, getElementbyId AND getElementbyClass was a bit difficult to grasp.

Oh well, its working now. and I fucking love it!

The jQuery

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
$(document).ready(function() {
 
	$('content').ready(function() {
		if($.browser.mozilla && $.browser.version.substr(0,3) == "1.9") {
			$('#content').toggleClass('mozillaborder');
				$('#leftCorner').css('display', 'none');
					$('#contentSpacer').css('display', 'none');
						$('#rightCorner').css('display', 'none');
		}
	});
 
	$('content').ready(function() {
		if($.browser.safari && $.browser.version.substr(0,3) == "53") {
			$('#content').toggleClass('webkitborder');
				$('#leftCorner').css('display', 'none');
					$('#contentSpacer').css('display', 'none');
						$('#rightCorner').css('display', 'none');
		}
	});
 
});

The CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
.mozillaborder {
 
	-moz-border-radius-topleft:30px;
	-moz-border-radius-topright:30px;
	padding-top:15px!important;
 
}
 
.webkitborder {
 
	-webkit-border-top-left-radius:30px;
	-webkit-border-top-right-radius:30px;
	padding-top:15px!important;
 
}

Basically.. it replaces my corner images with the new -moz-border-radius attribute on my website when shown in mozilla, I will do this again for safari(and chrome when supported by jQuery.browser)

More to the point, I got something done in jQuery, I honestly struggled through javascript this year, it hasnt been my forte, but PHP has been so much fun!

Anyway, That is all.
Chur, Killa

EDIT – it now works for safari too!, Can’t wait til the other browsers support this and I can add more jQuery!

EDIT 2 – it works in chrome now. By removing the 1 and switching the safari substr() to 0,2 it means it works with 530.0->539.9 of webkit, then I’ll look for another work around.

No Comments Yet

Leave a comment