Created
May 25, 2016 12:24
-
-
Save alexvas123/8f3dc78471c65abeeb3aae7b45886f66 to your computer and use it in GitHub Desktop.
AJAX Switch Case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//AJAX BEGINS | |
$('.buttonsContainer').find('a').on('click', function (e) { | |
e.preventDefault(); | |
cache: false; | |
$('.jumbo').fadeOut(); | |
var attrValue = $(this).attr('href'); | |
switch (attrValue) { | |
case 'agnetha.html': | |
$('#hidden').load('agnetha.html').fadeIn(); | |
break; | |
case 'bjorn.html': | |
$('#hidden').load('bjorn.html').fadeIn(); | |
break; | |
case 'benny.html': | |
$('#hidden').load('benny.html').fadeIn(); | |
break; | |
case 'frida.html': | |
$('#hidden').load('frida.html').fadeIn(); | |
break; | |
case 'bennyBjorn.html': | |
$('#hidden').load('bennyBjorn.html').fadeIn(); | |
break; | |
case 'stig.html': | |
$('#hidden').load('stig.html').fadeIn(); | |
break; | |
case 'band.html': | |
$('#hidden').load('band.html').fadeIn(); | |
break; | |
} | |
}); | |
//AJAX ENDS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment