Learn how to use jQuery at the Blog

Mummbai Indian Street Food « visit

  • Added 7 months ago
  • 112 Lines of Code shown
  • 2 Links of Interest
http://mummbai.dk
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to Mummbai Indian Street Food - http://mummbai.dk

if(typeof $ !== 'undefined' && typeof $$ === 'undefined') {
$(function() {
	$.extend({
		fontSizeControls: {
			orgSize: $('html').css('font-size'),
			controls: {
				increase: {
					title: 	'Større tekst',
					label: 	'aA +'
				},
				decrease: {
					title: 	'Mindre tekst',
					label: 	'Aa -'
				},
				reset: {
					title: 	'Nulstil tekststørrelse',
					label: 	'Nulstil'
				}
			},
			toggle: function(type) {
				if(type == 'reset') {
					$('html').css('font-size', this.orgSize);
				} else {
					scale = ((type == 'increase') ? 1.1 : 0.9);

					var current = parseFloat($('html').css('font-size'), 10);
					$('html').css('font-size', current*scale);
				}
			},
			insertIn: function(elm) {
				$(elm).append(
					$(document.createElement('span'))
						.addClass('fontSizeControls')
						.append(
							$(document.createElement('em'))
							.text('Tekststørrelse: ')
							.css('visibility', 'hidden')
						)
						.mouseover(function(){
							$('em', this).css('visibility', 'visible');
						})
						.mouseout(function(){
							$('em', this).css('visibility', 'hidden');
						})
				)
				$.each(this.controls, function(control) {
					var c = $.fontSizeControls.controls[control];
					
					$('.fontSizeControls', elm).append(
						$(document.createElement('a'))
							.attr({
								title: c.title,
								href: '#'
							})
							.addClass(control)
							.text(c.label)
							.click(function(event) {
								$.fontSizeControls.toggle(control);
								event.preventDefault();
							})
					)
				});
			}
		}
	});
});
}
else throw 'Either jQuery is not loaded or there\'s a conflict with $ function';



$(function() {
	addthis_pub					= 'mummbai';
	addthis_brand				= 'Mummbai.dk';
	addthis_header_background 	= '#d66200';
	addthis_header_color		= '#fff';
	addthis_options				= 'email, favorites, facebook, myspace, twitter, google, linkedin, more';
	
	$('#toolbar p')
		.append(
			$(document.createElement('a'))
			.attr({
				id: 	'addThisButton',
				href: 	'http://www.addthis.com/bookmark.php?v=20'
			})
			.append(
				$(document.createElement('img'))
				.attr({
					src: 'http://s7.addthis.com/static/btn/lg-share-en.gif',
					alt: 'Tip en ven'
				})
			)
			.click(function(event){
				addthis_sendto();
				event.preventDefault();
			})
			.mouseover(	function(){	addthis_open(this, '', 'http://mummbai.dk', 'Arbejde på Roskilde Festival')})
			.mouseout(	function(){	addthis_close()})
		)
	;
	$.fontSizeControls.insertIn('#toolbar p');

	
	if($('.gallery')) {
		$('.gallery a')
			.attr({
				rel: 	'frontpage-gallery',
				title: 	'Mummbai @ Roskilde 2008'
			})
			.fancybox()
	}
});