Skip to content

Instantly share code, notes, and snippets.

@kevinsmith
Created April 21, 2011 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinsmith/935540 to your computer and use it in GitHub Desktop.
Save kevinsmith/935540 to your computer and use it in GitHub Desktop.
Some JS to allow a dropdown panel to slide out as long as the link's class name matches the panel's ID name.
$(document).ready(function(){
// Owner's Box animation
$('#owners_box ul a, .outside_donations').click(function() {
$('#dimmedBG').fadeIn(150);
var className = $(this).attr("class");
var idName = "#"+className;
$('.owners_dropdown').not(idName).fadeOut(100, function() {
$(idName).slideDown(400, function() {
if (idName == "#outside_donations") { $('input.donation').focus(); }
});
// Fade animation complete.
});
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment