/ Published in: jQuery
.closest and .find are very useful - surprised I haven't heard of them before.
Expand |
Embed | Plain Text
// Expand Tables $(".expandTable").toggle( function(){ $(this).closest('.tableSection').find('.tradeTable').fadeIn(); $(this).closest('.tableSection').find('.arrow').html('↓'); }, function(){ $(this).closest('.tableSection').find('.tradeTable').fadeOut(); $(this).closest('.tableSection').find('.arrow').html('→'); } );
You need to login to post a comment.
