Solved

Simple fancybox question

Posted on 2013-05-31
2
322 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
ID: 39212185
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
ID: 39212385
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iOS 10 iPad Zoom and acroll 4 74
combining jquery scripts 3 27
Replace &lt; with < 14 61
jQuery Validate 4 40
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 …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

825 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