I am using fancybox (http://fancyapps.com) in my application. I have a div defined like this:
<div id="dialog-user-login" title="User Login" style="display: none" class="popup-dv">
<div id="myDivID7">
<div class="up-content">
Your Contents SHow HERE
<input id="txtUserName" name="txtUserName" class="normal" type="text" /><br />
<input id="txtpassword" name="txtUserName" class="normal" type="password" /><br />
</div>
<div class="social-icons">
<img src="wp-content/themes/touch/images/twit-icon.png" width="65" height="22">
<img src="wp-content/themes/touch/images/face-icon.png" width="65" height="22">
</div>
</div>
</div>
I have included these files:
<script src="../../Content/FancyBox/jquery-1.9.0.min.js" type="text/javascript"></script>
<link href="../../Content/FancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css" />
<script src="../../Content/FancyBox/jquery.fancybox.js" type="text/javascript"></script>
and using this code
$(document).ready(function () {
$("a#fancyBoxLink1").click();
});
1) It shows the fancybox but when i click overlay, it closes.
2). If I use following code, it doesn’t work:
$("a#fancyBoxLink1").fancybox({
'href': '#myDivID1',
'titleShow': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic'
});
with this html:
<a href="#myDivID1" class="mrgn-ao" id="fancyBoxLink1">
<div id="dialog-user-login" title="User Login" style="display: none" class="popup-dv">
<div id="myDivID7">
<div class="up-content">
Your Contenssssssssssssssssssssssssssssssssssssssssssssssssssst SHow HERE
<input id="txtUserName" name="txtUserName" class="normal" type="text" /><br />
<input id="txtpassword" name="txtUserName" class="normal" type="password" /><br />
</div>
<div class="social-icons">
<img src="wp-content/themes/touch/images/twit-icon.png" width="65" height="22">
<img src="wp-content/themes/touch/images/face-icon.png" width="65" height="22">
</div>
</div>
</div>
</a>
Please suggest me what is wrong with my code.
You need add in the
<head>code:On the
<body>code:href – this is the link of pop-up-div