调用javascript函数时如何显示jquery poup [英] how to show a jquery poup when call a javascript function
问题描述
我正在做一个项目,并且是编程的新手.现在我被javascript困住了.我的要求是显示一个jQuery弹出窗口.现在我可以使用< href>标签.
href标记中包含一个类,该类有助于显示弹出窗口.
实际上,我需要的是在我用javascript调用函数时显示弹出窗口.
我需要在调用javascript函数时出现弹出窗口.
我会在下面提到代码.对不起,英语不好.
请帮助我
======================
Hi,
I am doing a project and am new in programming. and i am now stuck with javascript. My requirement is to show a jquery popup. now i can show a popup using < a href> tag.
In this a href tag contains a class, and this class helps to show the popup.
Actually what i need is to show the popup when i call the function in javascript.
I need when i call the javascript function the popup will appear.
i''ll mentioned the code below. And sorry for the bad English.
Please HELP ME
=======================
<html>
<head>
<title></title>
<style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="../colorbox/jquery.colorbox.js"></script>
<script>
$(document).ready(function () {
$(".inline").colorbox({ inline: true, width: "50%" });
});
</script>
</head>
<body>
<form>
<div>
<p><a class='inline' href="#inline_content">Show Popup</a></p>
<!-- This is the content to show inside the poup-->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This is the popup content.</strong></p>
</div>
</div>
</div>
</form>
</body>
</html>
================
在这里,类名"Inline"有助于打开弹出窗口,而"#inline_content" ID是弹出窗口中的内容……
请帮助我..紧急...请..
如果您需要任何澄清,请问我.我会为您提供...
谢谢.
================
Here the class name "Inline" helps to open the popup and "#inline_content" id is the content inside the poup......
Please help me.. its urgent... please..
If you need any clarification please ask me.. i''ll provide you...
Thanks.
推荐答案
(document).ready(function(){
(document).ready(function () {
(.inline").colorbox({内联:true,宽度:"50%"}); }); < /script > < /head > < 正文 > < 表单 > < div > < p > < a =' href =" > 显示弹出窗口< /a > < /p > <!- 这是要显示在Poup内部的内容 -> < div =' > < div =' =' > < p > < strong > 这是弹出内容. < /strong > < /p > < /div > < /div > < /div > < /form > < /body > < /html >
(".inline").colorbox({ inline: true, width: "50%" }); }); </script> </head> <body> <form> <div> <p><a class='inline' href="#inline_content">Show Popup</a></p> <!-- This is the content to show inside the poup--> <div style='display:none'> <div id='inline_content' style='padding:10px; background:#fff;'> <p><strong>This is the popup content.</strong></p> </div> </div> </div> </form> </body> </html>
================
在这里,类名"Inline"有助于打开弹出窗口,而"#inline_content" ID是弹出窗口中的内容……
请帮助我..紧急...请..
如果您需要任何澄清,请问我.我会为您提供...
谢谢.
================
Here the class name "Inline" helps to open the popup and "#inline_content" id is the content inside the poup......
Please help me.. its urgent... please..
If you need any clarification please ask me.. i''ll provide you...
Thanks.
实际上,该弹出窗口是使用Href方法打开的,例如:在Href标签中,它们包括类名和Href重定向...
Actually the popup are open using the Href method eg : in Href tag they include the class name and Href redirection...
<a class="inline" href="#inline_content">Show Popup</a>
实际上我需要我不需要href ...而不是href,当我们调用javascript函数时,将显示此弹出窗口.
在javascript函数内部,我们必须编写代码来打开此Poup....
谢谢...
Actually i need i dont need the href... instead of href this popup will shown in when we call a javascript function.
Inside the javascript function we have to write the code for open this poup....
Thanks...
这篇关于调用javascript函数时如何显示jquery poup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!