I'm trying to figure out if it would make more sense to turn the following code into a switch statement. How would I write it?
I appreciate your help!Code:$('#loading').hide(); $('#sub-web-design').click(function(){ $('#loading').show(); $('#dynamic').load('/what-we-do/web-design', function() { $('#loading').hide(); $(this).fadeIn('slow'); }); return false; }); $('#sub-graphic-design').click(function(){ $('#loading').show(); $('#dynamic').load('/what-we-do/graphic-design', function() { $('#loading').hide(); $(this).fadeIn('slow'); }); return false; }); $('#sub-branding').click(function(){ $('#loading').show(); $('#dynamic').load('/what-we-do/branding', function() { $('#loading').hide(); $(this).fadeIn('slow'); }); return false; }); $('#sub-content-management').click(function(){ $('#loading').show(); $('#dynamic').load('/what-we-do/content-management', function() { $('#loading').hide(); $(this).fadeIn('slow'); }); return false; }); $('#sub-seo').click(function(){ $('#loading').show(); $('#dynamic').load('/what-we-do/seo', function() { $('#loading').hide(); $(this).fadeIn('slow'); }); return false; });






Bookmarks