Skip to content

Instantly share code, notes, and snippets.

@jaseflow
Created July 11, 2013 03:00
Show Gist options
  • Select an option

  • Save jaseflow/5972204 to your computer and use it in GitHub Desktop.

Select an option

Save jaseflow/5972204 to your computer and use it in GitHub Desktop.
$('.pkg-selection').fastClick(function() {
var optionsHeight = $('#options').outerHeight();
// Load appropriate option list
var content = $(this).attr('id');
$('#options').load('/components/packagesOptions/' + content + '.html', function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$('#error').html(msg + xhr.status + " " + xhr.statusText);
};
});
// Shift canvas to the right to display option list
$('.canvas__wrap').addClass('canvas__wrap--second');
// Set height of the parent canvas by finding the height of the options
$('.canvas').css('height', optionsHeight);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment