开发者

execute javascript when a usercontrol become visible

开发者 https://www.devze.com 2022-12-20 02:50 出处:网络
I have a usercontrol wich is visible=false when the page is loaded. Then, it becomes visible=true. I want some javascript to be executed when this usercontrol is set to visible=true in the code-behi开

I have a usercontrol wich is visible=false when the page is loaded. Then, it becomes visible=true. I want some javascript to be executed when this usercontrol is set to visible=true in the code-behi开发者_开发知识库nd. the only solution i found is to use ScriptManager.RegisterStartupScript in the

usercontrol's code behind. But i don't like writing my javascript in the codeBehind.

This jQuery in the usercontrol doesn't work : $(document).ready(function() { alert('test'); });

The usercontrol is into an updatepanel.


Try this jQuery plugin. It makes use of the onpropertychange event in IE and the DOMAttrModified mutation event in supported browsers. With it, you should be able to watch for the visibility property being changed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号