admin管理员组文章数量:1327102
i have index html page in my site, its the main page. in the index html i have a button and by clicking it i want to open a popup form, i have the js file and css file of this popup included in the index html.
i just cant open this animated popup by clicking the input type button.. can anyone help me?
the clouds js:
$(function ()
{
// Register Smart skin.
$.speedoPopup.registerSmartSkin('clouds', function (overlay, container)
{
// We don't want to brake anything if there is no overlay.
if (!overlay)
{
return ;
}
if ($.speedoPopup.browser_ie && $.speedoPopup.browser_ie< 9)
{
return;
}
var clouds = '<div class="cloud x1"></div><div class="cloud x2"></div><div class="cloud x3"></div><div class="cloud x4"></div><div class="cloud x5"></div>';
overlay.append(clouds);
});
});
index html: below the head tag
<link type='text/css' href='clouds/clouds.css' rel='stylesheet' media='screen' />
<script type='text/javascript' src='clouds/clouds.js'></script>
and the button:
<div>
<input type='button' name='clouds' value='Clouds'/>
</div>
i have index html page in my site, its the main page. in the index html i have a button and by clicking it i want to open a popup form, i have the js file and css file of this popup included in the index html.
i just cant open this animated popup by clicking the input type button.. can anyone help me?
the clouds js:
$(function ()
{
// Register Smart skin.
$.speedoPopup.registerSmartSkin('clouds', function (overlay, container)
{
// We don't want to brake anything if there is no overlay.
if (!overlay)
{
return ;
}
if ($.speedoPopup.browser_ie && $.speedoPopup.browser_ie< 9)
{
return;
}
var clouds = '<div class="cloud x1"></div><div class="cloud x2"></div><div class="cloud x3"></div><div class="cloud x4"></div><div class="cloud x5"></div>';
overlay.append(clouds);
});
});
index html: below the head tag
<link type='text/css' href='clouds/clouds.css' rel='stylesheet' media='screen' />
<script type='text/javascript' src='clouds/clouds.js'></script>
and the button:
<div>
<input type='button' name='clouds' value='Clouds'/>
</div>
Share
Improve this question
asked May 22, 2013 at 13:10
shmnswshmnsw
6493 gold badges11 silver badges24 bronze badges
2
-
have you included jQuery in the
<head>
of your file? Also, try setting your problem up in a jsfiddle. – zik Commented May 22, 2013 at 13:14 - Yes.. this is what i wrote.. clouds.js included look up – shmnsw Commented May 22, 2013 at 13:17
1 Answer
Reset to default 1You have to invoke the dialog on click
Lets give you button an id
<div>
<input id="btnDialog" type='button' name='clouds' value='Clouds'/>
</div>
Now create a div that you want to show in dialog
<div id="divContentToPopup">
...content here...
</div>
now you have to hook a click event on it
$('#btnDialog').click(function ()
{
$(this).speedoPopup(
{
width:550,
height:265,
useFrame: TRUE,
href: '#divContentToPopup'
});
});
本文标签: javascriptopen js popup by clicking a buttonStack Overflow
版权声明:本文标题:javascript - open js popup by clicking a button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742205033a2432656.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论