This happen because event handler toggles function not on both element, but on each of them separately (you would not wonder if $('#e1,#e2').click(function)
will not fire event on both elements if you click on e1 ), to workaround I would to make something like:
$(function () {
var $clickmeright=$("#clickmeright");
$("#clickmeleft").click(function() {
$clickmeright.click();
})
$clickmeright.toggle(function () {
$(this).parent().animate({
right: '0px'
}, {
queue: false,
duration: 500
});
}, function () {
$(this).parent().animate({
right: '-170px'
}, {
queue: false,
duration: 500
});
});
});