Reputation: 21
I think this is probably a pretty easy question, I think I've been staring at this for to long.
Basically, how can I get this 'click' event on one div to trigger the other div to move.
$(".button").click(function () {
$(.green).toggle("slide", { direction: "left" }, 1000);
});
I know it works like this
$(".button").click(function () {
$(this).toggle("slide", { direction: "left" }, 1000);
});
But I don't want that .button to slide, I want the .green to slide on click of .button.
Make sense?
Upvotes: 0
Views: 282
Reputation: 94429
$(".button").click(function () {
$(".green").toggle("slide", { direction: "left" }, 1000);//Missing quotes
});
Upvotes: 0
Reputation: 4133
You forgot quotes:
$(".button").click(function () {
$('.green').toggle("slide", { direction: "left" }, 1000);
});
Upvotes: 1