Reputation: 4171
I'm calling this function but I need to slideup the parent div of the link that was clicked.
This function is called from a normal link:
function close(){
$(this).slideUp('slow', function() {
});
}
How do i reference the element that was clicked (link), then get it's grandparent? I want to slideup not this links parent div, but the parent div of the link div.
I hope that makes sense.
Upvotes: 0
Views: 825
Reputation: 4171
This is what worked:
onclick="javascript:$(this).parent().slideUp('slow');"
Upvotes: 1
Reputation: 4152
What this function does is:
so:
function close(){
$('elementToSlideUp').click(function(evt) {
jQuery(this).parent().slideUp('slow');
});
}
Upvotes: 0
Reputation: 2209
Is this what you are looking for?
$('div > a').click(function() {
$(this).parent().slideUp('slow', function() {
});
});
Upvotes: 0