开发者

Attach/bind an event to jquery UI Dialog exit 'X'

I need to attach an event to this. I cannot change the function for closing since this is a custom databound control. So I need to navigate the开发者_如何转开发 DOM to find the element. I have isolated the element by doing this:

function getXButton () {
    var titlebar = getElementsByClassName('ui-dialog-titlebar');
    var titleBarChildren = titlebar[0].childNodes;
    var exitAncor = titleBarChildren[1];
    var exitSpan = exitAnchor.childNodes;
}

getElementsByClassName is a custom function that navigates the whole page and finds this element. I have the exitAnchor and exitSpan. How the hell do I now apply an onclick function to them?


$('.ui-dialog-titlebar-close').live('click',function(){

});

bind what you need to the onClick of the a tag surrounding that x?

the live binding method ties it to elements that either are or will be on the page that match that class.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜