调用函数时如何打开弹出窗口 [英] How to open the popup when i call a function

查看:69
本文介绍了调用函数时如何打开弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,

我有一个弹出代码....

Dear sir,

I have a Popup Code....

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>POPup</title>
		
		<link rel="stylesheet" type="text/css" href="style.css" />
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
		<script type="text/javascript" src="jquery.leanModal.min.js"></script>
        

		<script type="text/javascript">
		    $(function () {
		        $('a[rel*=leanModal]').leanModal({ top: 200, closeButton: ".modal_close" });
		    });
		</script>

		
	</head>
	<body>


	 <a id="go" rel="leanModal" name="signup" href="#signup">Open</a>
		
		
		<div id="signup">
			<div id="signup-ct">
				<div id="signup-header">
					<h2>Create a new account</h2>
					<p>It's simple, and free.</p>
					<a class="modal_close" href="#"></a>
				</div>
				
				<form action="">
     
				  <div class="txt-fld">
				    <label for="">Username</label>
				    <input id="" class="good_input" name="" type="text" />

				  </div>
				  <div class="txt-fld">
				    <label for="">Email address</label>
				    <input id="" name="" type="text" />
				  </div>
				  <div class="txt-fld">
				    <label for="">Password</label>
				    <input id="" name="" type="text" />

				  </div>
				  <div class="btn-fld">
				  <button type="submit">Sign Up »</button>
</div>





				 </form>
			</div>
		</div>


		
	</body>
</html>




当我单击打开链接"时,弹出窗口将打开.
在这里,我们使用了href标签...

我需要将其转换为函数.

调用函数时需要打开弹出窗口.

这个怎么做.请帮帮我.


谢谢

Dileep ...




Here the popup will open When i click the Open Link.
Here we used a href tag...

I need to convert it into a function.

I need to open the popup when i call a function .

How to do this. please help me.


Thanks

Dileep...

推荐答案

( function (){


(' a [rel * = leanModal]').leanModal({top: 200 ,closeButton:" }); }); < / 脚本 > < /head > < 正文 > < a =" go" rel leanModal" 名称 =" 注册" href #signup" < > < div id 注册" < div =" signup-ct" < div =" signup-header" < h2 > 创建新account < /h2 > < p > 这很简单,并且免费.< /p > < a =" modal_close" href >#" > < /a > < /div > < 表单 =" > < div =" txt-fld" < 标签 =" > 用户名< /label > < 输入 =" " =" ="span> 名称 =" " 类型 =" / > < /div > < div =" txt-fld" < 标签 =" > 电子邮件地址< /label > < 输入 =" " 名称 =" 类型 =" 文本" / > < /div > < div =" txt-fld" < 标签 =" > 密码< /label > < 输入 =" " 名称 =" 类型 =" 文本" / > < /div > < div =" btn-fld" < 按钮 =" 提交" < > < /div > < /form > < /div > < /div > < /body > < /html >
('a[rel*=leanModal]').leanModal({ top: 200, closeButton: ".modal_close" }); }); </script> </head> <body> <a id="go" rel="leanModal" name="signup" href="#signup">Open</a> <div id="signup"> <div id="signup-ct"> <div id="signup-header"> <h2>Create a new account</h2> <p>It's simple, and free.</p> <a class="modal_close" href="#"></a> </div> <form action=""> <div class="txt-fld"> <label for="">Username</label> <input id="" class="good_input" name="" type="text" /> </div> <div class="txt-fld"> <label for="">Email address</label> <input id="" name="" type="text" /> </div> <div class="txt-fld"> <label for="">Password</label> <input id="" name="" type="text" /> </div> <div class="btn-fld"> <button type="submit">Sign Up »</button> </div> </form> </div> </div> </body> </html>




当我单击打开链接"时,弹出窗口将打开.
在这里,我们使用了href标签...

我需要将其转换为函数.

调用函数时需要打开弹出窗口.

这个怎么做.请帮帮我.


谢谢

Dileep ...




Here the popup will open When i click the Open Link.
Here we used a href tag...

I need to convert it into a function.

I need to open the popup when i call a function .

How to do this. please help me.


Thanks

Dileep...


不应该做这样的事情:
Should not be doing something like this:
<input type="button" onclick="LaunchPopup()" />
function LaunchPopup()
{
  alert("Hi there!");
}


您尝试了吗?


Did you try?


这篇关于调用函数时如何打开弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆