Thursday, 5 September 2013

Basic Javascript help - Click event

Basic Javascript help - Click event

I am creating a show more button to extend the div "expandable"
This code below works but works when the user clicks ANYWHERE on the
document.
$(document).click(function() {
$('.expandable').animate({
'height': '100%',
})
})
This code below should work I believe? When the user clicks on the div
"show-more-btn" but it doesn't:
$('#show-more-btn').click(function() {
$('.expandable').animate({
'height': '100%',
})
})

No comments:

Post a Comment