Cant get my iframe window to open in fancybox it jsut opens in a new window

910 views
Skip to first unread message

nick1988

unread,
Feb 10, 2011, 10:43:23 AM2/10/11
to fancybox
Hi hoping someone can help i have been trying for about 4 hours now, i
have downlaoded all of the fancybox files and followed the guide and i
still cant get my second .aspx page to open up within a fancybox it
just opens on a new page

this is what i have put inside the head of my page

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
!window.jQuery && document.write('<script src="/jquery-1.4.3.min.js"><
\/script>');
</script>
<script type="text/javascript" src="/fancybox/
jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="/fancybox/
jquery.easing-1.3.pack.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox-1.3.4.css"
type="text/css" media="screen" />
<script type="text/javascript">
$(document).ready(function () {

$("#fb1").fancybox({
'width': '75%',
'height': '75%',
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'type': 'iframe'
});

});
</script>

and then within one of my div tags I have put

<a id="fb1" href="CourseList.aspx">Click Here</a>

Can anyone see what I am doing wrong? Any help would be greatly
appreciated.

Thanks,

Nick

JFK

unread,
Feb 10, 2011, 8:30:59 PM2/10/11
to fancybox
don't use ID for more than one instance within the same document, use
classes instead
so this
$("#fb1").fancybox({ ....
should be this
$(".fb1").fancybox({

and this
<a id="fb1" ...
should be this
< class="fb1"...

nick1988

unread,
Feb 11, 2011, 12:12:48 PM2/11/11
to fancybox
Hi, Thanks for the information I have changed it to classes now!

For anyone that is interested with the original problem it was due to
the fact that the jquery lib was also being called further down the
page for a menu I have, removing that instance of Jquery allowed
FancyBox to operate correctly.
Reply all
Reply to author
Forward
0 new messages