0
votes

http://jspears8.mydevryportfolio.com/gallery1.html

I uploaded to my school portfolio in hopes of giving a real vision of what is taking place. The the first fancybox element you open doesn't work. I'm using a prebuilt fancybox css. I've tried several others. In my actual page, it loads an empty fancybox and will load anything cycled through, but that first click when you wander to the page is blank white each time.

What am I doing wrong? This is the gallery below.

<div id="gallery">
    <a href="images/AlatheusEberwolf.jpg" rel="Gallery" title="Alatheus Eberwolf"><img src="images/thumbs/AlatheusEberwolf_t.jpg" width="94" height="94" alt="Alatheus Eberwolf"></a>
    <a href="images/Quentin_II.jpg" rel="Gallery" title="Quentin II"><img src="images/thumbs/Quentin_II_t.jpg" width="94" height="94" alt="Quentin II"></a>
    <a href="images/RolithAlinaEngaged.jpg" rel="Gallery" title="Rolith and Alina Get Engaged"><img src="images/thumbs/RolithAlinaEngaged_t.jpg" width="94" height="94" alt="Rolith and Alina Get Engaged!"></a>
    <a href="images/RolithAlinaMarried.jpg" rel="Gallery" title="Rolith and Alina Get Married"><img src="images/thumbs/RolithAlinaMarried_t.jpg" width="94" height="94" alt="Rolith and Alina Get Married"></a>
    <a href="images/Spear-of-the-Ancients.jpg" rel="Gallery" title="Spear of the Ancients"> <img src="images/thumbs/Spear-of-the-Ancients_t.jpg" width="94" height="94" alt="Spear of the Ancients"></a>
    <a href="images/Tep_Itaki.jpg" rel="Gallery" title="Tep Itaki"><img src="images/thumbs/Tep_Itaki_t.jpg" width="94" height="94" alt="Tep Itaki"></a>
</div>

Javascript

$(document).ready(function() { $('#gallery a').fancybox({ overlayColor: '#0CF', overlayOpacity: .3, transitionIn: 'elastic', transitionOut: 'elastic', easingIn: 'easeInSine', easingOut: 'easeOutSine', titlePosition: 'outside' ,
cyclic: true }); }); // end ready

1
I don't see a problem, please specify your question to a specific part or just copy the specific code related to you question to make it clear. - CME64
What am I doing wrong? Not providing a problem with code we can see. We really won't be able to help otherwise. - Panama Jack
Forgive me. I'm personally new to javascript and jquery. I don't understand what is wrong to show. - Joseph Spears
Edited to show related code. - Joseph Spears

1 Answers

0
votes

In a quick review of your page I can see the following:

  1. You call twice jQuery (_js/jquery-1.7.2.min.js and _js/jquery.js)
  2. Your call to the jQuery must be before the fancybox call

Take a look at the <head> tag in your HTML:

<meta charset="utf-8">
<title>Course Project</title>
<link type="text/css" rel="stylesheet" href="_css/layout.css">
<link rel="stylesheet" href="fancybox/jquery.fancybox-1.3.4.css">
<script id="twitter-wjs" src="http://platform.twitter.com/widgets.js">
<script src="_js/jquery-1.7.2.min.js">
<script src="_js/jquery.easing.1.3.js">
<script src="fancybox/jquery.fancybox-1.3.4.min.js">
<script src="_js/jquery.js" type="text/javascript">
<script src="_js/interface.js" type="text/javascript">
<style type="text/css">
<script type="text/javascript">
<link type="text/css" rel="stylesheet" href="dockstyle.css">
<style type="text/css">
<link type="text/css" rel="stylesheet" href="navstyle.css">

Your fancybox example works fine if you have only:

<link rel="stylesheet" href="fancybox/jquery.fancybox-1.3.4.css">
<script src="_js/jquery-1.7.2.min.js">
<script src="fancybox/jquery.fancybox-1.3.4.min.js">

So I believe some javascript methods are overiding.

I hope this helps