Solved

Simple fancybox question

Posted on 2013-05-31
2
320 Views
Last Modified: 2013-05-31
I know I must be doing something incredibly obviously wrong here, but for the life of me I can't see what.

I am just trying to use fancybox to show the contents of a hidden div in my page. But when I click on the link, fancybox just shows a tiny empty box.

You can see an example here:
http://s1053289.instanturl.net/fancyboxtest.html

And below is the full source:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language="JavaScript" type="text/javascript" src="wp-content/themes/globalpartnerships/include/commonfunctions.js"></script>
<script src="http://www.google.com/jsapi"></script>
<script language="JavaScript" type="text/javascript" src="wp-content/themes/globalpartnerships/include/jqueryloader.js"></script>
<script language="JavaScript" type="text/javascript" src="wp-content/themes/globalpartnerships/include/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="wp-content/themes/globalpartnerships/include/fancybox/jquery.easing-1.3.pack.js"></script>
<script type=text/javascript>
$(document).ready(function()
{
	$("a.fancyboxtest").fancybox({	});
}); // $(document).ready(function()
</script>
<link href="wp-content/themes/globalpartnerships/stylesheet-int.css" rel="stylesheet" type="text/css" media="screen">
<link rel="stylesheet" href="wp-content/themes/globalpartnerships/include/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen">
</head>
<body>
      <a id="inline" href="#testcase" class="fancyboxtest">test case</a>
      <div id="testcase" style="display:none;">This is a test case</div>
</body>
</html>

Open in new window


Can anyone help put me out of my misery? :)

Thanks experts!
0
Comment
Question by:rascal
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
Usage:
<body>
      <a id="inline" href="#testcase" class="fancyboxtest">test case</a>
      <div style="display:none"><div id="testcase">This is a test case</div></div>
</body>

Open in new window

0
 
LVL 1

Author Closing Comment

by:rascal
Comment Utility
Ah, thanks so much Gary - I missed that the div I wanted to show had to be wrapped in an outer hidden div!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now