Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery 'this' for elements children

Im just getting to grips with jquery and im trying to write something like this, please note the puesdo code on the 3rd line.

How can i write this (as in the .tile) and then select the tiles box element.

$(document).ready(function() {
    $('.tile').hover(function () {
        $('this->.box').stop().slideToggle("300");
    });     
});

Ive made a jsfiddle of the problem here - http://jsfiddle.net/pudle/m6ZjH/2/

like image 975
sam Avatar asked Apr 10 '26 07:04

sam


1 Answers

$(document).ready(function() {
    $('.tile').hover(function () {
        $(this).children('.box').stop().slideToggle("300");
    });     
});

Here's your fiddle updated.

like image 149
Konstantin Dinev Avatar answered Apr 11 '26 19:04

Konstantin Dinev