[英]calling jquery from a javascript function
<html>
<head>
<script type="text/javascript">
function display(id)
{
// open jquery modal window using jquery UI
}
</script>
</head>
<body>
</body>
</html>
I want to open jquery modal window using jquery UI whenever the function display is called using normal javascript function call . 每当使用普通的javascript函数调用调用函数显示时,我都想使用jquery UI打开jquery模态窗口。
I can use .diolog function of jquery UI , but how to call it from within javascript function ? 我可以使用jquery UI的.diolog函数,但是如何从javascript函数中调用它?
Thanks 谢谢
You can just use a selector and call .dialog()
, like this: 您可以使用选择器并调用
.dialog()
,如下所示:
function display(id)
{
$("#"+id).dialog();
}
This uses the passed id
for the #ID
selector then just calls .dialog()
for that element. 这
#ID
传递的id
用于#ID
选择器,然后仅对该元素调用.dialog()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.