Including jQuery FancyBox
-
I can’t make FancyBox work.
<?php wp_enqueue_script("jquery"); ?> <?php wp_head(); ?> <script type="text/javascript" src="./fancybox/jquery.mousewheel-3.0.4.pack.js"></script> <script type="text/javascript" src="./fancybox/jquery.fancybox-1.3.4.pack.js"></script> <link rel="stylesheet" type="text/css" href="./fancybox/jquery.fancybox-1.3.4.css" media="screen" /> <script type="text/javascript"> var $j = jQuery.noConflict(); $j(document).ready(function() { $j("a[rel=example_group]").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over', 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>'; } }); }); </script>
Here I called the wp_enqueue_script before the wp_head and FancyBox jQuery JavaScript after that. I also put the jQuery into “no conflict” mode to be safe. Then paste the FancyBox files in the Theme Folder.
<a rel="example_group" href="#.jpg"><img class="size-thumbnail wp-image-158" title="pool" src="#.jpg" width="150" height="150" />
In admin panel, after adding image I put rel=”example_group” on the link. I don’t know if im doing this right, newbie here.
Appreciate your help.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Including jQuery FancyBox’ is closed to new replies.