jQuery UI confirmation dialog - manipulating output

依然范特西╮ 提交于 2020-01-04 05:31:21

问题


I need to modify the dialog confirmation buttons. I want to have the confirm and cancel buttons swapped around (so cancel is to the right not the left of the confirm button). I also want to change the background image on the confirm button so that it's a different colour. I thought about doing this in seperate jQuery code so that I don't have to dig into the UI code and modify it. First of all can this be done?

Secondly if I grab the div with the css class 'ui-dialog-buttonpane' as my selector. Which is the div surrounding the button controls. How can I select JUST the confirm button? Is there a way I can say I want a child control of type button that contains the text 'confirm'?

TIA

Lloyd


回答1:


1) order the buttons in the dialog settings in the order you wish them to appear.

2) $('.ui-dialog-buttonpane').children('button')[1]



来源:https://stackoverflow.com/questions/1786368/jquery-ui-confirmation-dialog-manipulating-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!