There is a code:
$('#pollSlider-button').click(function () { if ($(this).css("margin-right") == "300px") { $('#mask').remove(); $('.pollSlider').animate({ "margin-right": '-=300', }); $('#pollSlider-button').animate({ "margin-right": '-=300' }); } else { // Add the mask to body $('body').append('<div id="mask"></div>'); $('#mask').fadeIn(300); $('.pollSlider').animate({ "margin-right": '+=300', "width": '=300' }); $('#pollSlider-button').animate({ "margin-right": '+=300', "width": '=300' }); } }); So, when you click on # pollSlider-button, all the work happens, but I need to, that if I clicked on # pollSlider-button and #mask, the action occurred. Tell me how to correct.