Skip to content

Instantly share code, notes, and snippets.

@alicanatas
Created May 7, 2018 12:23
Show Gist options
  • Save alicanatas/157981928bd48922ca63ba98473697a5 to your computer and use it in GitHub Desktop.
Save alicanatas/157981928bd48922ca63ba98473697a5 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
var $flowers = $('#flower-items');
$('#flower-items').find('a').on('click', function(e){
alert('a');
e.preventDefault();
var $desc = $('#flower-description');
switch($(this).attr('href')) {
case 'calla.html' :
alert('b')
$desc.load('fragments/lilies.html');
break;
case 'sunflowers.html' :
$desc.load('fragments/sunflower.html');
break;
case 'iris.html' :
$desc.load('fragments/irises.html');
break;
case 'alstromeria.html' :
$desc.load('fragments/peruvian.html');
break;
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment