1

I have a ModalPopupExtender that needs to be hidden whenever the user clicks anywhere else on the page, window, or scrollbar. I have a function and it works if i set it to a div tag but what about when the user clicks the windows scrollbar?

function HideList() {
    $find("<%=ModalPopupExtender1.BehaviorID%>").hide();
}

<div id="maindiv" onclick="HideList()">
    Elements...
</div>

1 Answer 1

1

AFAIK, it's not possible to target the scroll bar using JavaScript.

However, you can target the scroll event and any click event on the window:

$(window).bind('scroll click', function() {
    alert('Boo');
});
Sign up to request clarification or add additional context in comments.

1 Comment

Yup it worked! I replaced alert('Boo'); with HideList(); Thanks again!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.