• Trying to use Fancybox jQuery to load up URLs in an iFrame, not the actual WP Fancybox plugin. I got the code from fancybox.net and when I load it outside of my theme folder it works fine. When I copy the exact code into my Header as below and link to the JS files it loads Google in the full page as opposed to loading up Google in the fancybox. Tried everything, really need some guidance please…

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
    <link media='screen' href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css" />
    <meta charset='utf-8' />
    <?php wp_enqueue_script("jquery"); ?>
    <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script> <!-- jQuery -->
    <script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.2.pack.js"></script>
    <script type="text/javascript" src="fancybox/jquery.fancybox-1.3.1.js"></script>
    <link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.1.css" media="screen" />
          <script type="text/javascript">
    		$j=jQuery.noConflict();
    		$(document).ready(function() {
    
    			$("#various3").fancybox({
    				'width'				: '75%',
    				'height'			: '75%',
    				'autoScale'			: false,
    				'transitionIn'		: 'none',
    				'transitionOut'		: 'none',
    				'type'				: 'iframe'
    			});
    
    		});
    	</script>

    This is the link I use to test it out <a id="various3" href="http://google.ca">Iframe</a>

    I have a jQuery contact form on the same page and that works fine. I stripped that out to avois any conflicts, also didn’t work. If I put the index.html file that comes with fancybox into my wordpress folder it works great, but when i copy the code across it didn’t. Thought it might be my theme so tried it in default and another theme and still no luck.

    Any help would be much appreciated.

Viewing 1 replies (of 1 total)
  • I spent days trying to do implement this on my own and was never successful. I was shocked when I installed the Fancybox for WordPress plugin and I was up running in few minutes. Jose is a genius.

Viewing 1 replies (of 1 total)
  • The topic ‘Can't get simple jQuery working’ is closed to new replies.