PDA

View Full Version : Problem with Frog.js



Charlotte
08-25-2007, 12:45 AM
1) Script Title: frog.js

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/frogjs/index.htm

3) Describe problem: When I preview my site on Dreamweaver (before uploading to internet), the image viewer works perfectly--but, after uploading the files to my site and viewing the "live" website, the image viewer does not work. Here's a link to one of the pages which incorporates this java script that doesn't work: http://www.thepurplefrogdesigns.com/BusinessCardSamples.html

Any help would be greatly appreciated as I need to have this working as soon as possible.

Thanks!!!

jscheuer1
08-25-2007, 06:54 AM
You have an open tag spanning a script that it shouldn't:


<div id="FrogJS">

<p><a href="Samples/BusinessCards/1.jpg">
<img src="Samp . . .
. . . essCards/29_thumb.jpg"/></a>

<!-- BEGIN SCRIPT TO HIDE THUMBNAILS WHILE GALLERY LOADS -->
<script type="text/javascript">
<!--
var ribbit = document.getElementById('FrogJS');

// Adds loading message to FrogJS DIV
ribbit.innerHTML += 'Please wait while gallery loads<br /><img src="images/loading.gif" />';

// Hides thumbnails while gallery loads
var anchors = ribbit.getElementsByTagName('a');
for (var i=0; i<anchors.length; i++){
anchors[i].style.display = 'none';
}
-->
</script>

<!-- END SCRIPT TO HIDE THUMBNAILS WHILE GALLERY LOADS -->
</p>
</div>

Move it's closing tag to before that script:


. . .<a href="Samples/BusinessCards/27.jpg" >
<img src="Samples/BusinessCards/27_thumb.jpg"/></a>

<a href="Samples/BusinessCards/29.jpg" >
<img src="Samples/BusinessCards/29_thumb.jpg"/></a>
</p>
<!-- BEGIN SCRIPT TO HIDE THUMBNAILS WHILE GALLERY LOADS -->
<script type="text/javascript">
<!--
var ribbit = document.getElementById('FrogJS');

// Adds loading message to FrogJS DIV
ribbit.innerHTML += 'Please wait while gallery loads<br /><img src="images/loading.gif" />';

// Hides thumbnails while gallery loads
var anchors = ribbit.getElementsByTagName('a');
for (var i=0; i<anchors.length; i++){
anchors[i].style.display = 'none';
}
-->
</script>

<!-- END SCRIPT TO HIDE THUMBNAILS WHILE GALLERY LOADS -->

</div>

Added Info:

Or, you could just get rid of both the opening and closing <p></p> tags. I don't think they are really doing anything.