PDA

View Full Version : Images in Link Floatie Script



Cliftyman
07-27-2006, 01:43 AM
1) Link Floatie Script

2) http://www.dynamicdrive.com/dynamicindex5/linkfloaties.htm

3) I am using the link floatie script to display images on webpages. I am using the standard script with no modification. Other than referencing an image file instead of basic text and text formatting tags...



"var floattext=new Array()
floattext[0]='<img src="popup-bagdesigns.gif">"

Then I call the script like normal in the webpage using a hyperlink...


<a href="#" onMouseover="showfloatie(floattext[0], event, '#FCFAF2', 250, 100)" onMouseout="hidefloatie()" style="text-decoration: none">
<font face="Tahoma" color="#0072C6">Bag Design </font></a>

The problem I'm running into is the first time you click on the link it loads the image off the screen. After that initial mouseover the floatie displays the .gif fine... its just that first time you do a mouseover it loads it about 90% off the right side of the screen.

I've tried changing the position of the floatie, but it still does the same thing. Know of any way to keep it from goofing up that first time around? Thanks.

jscheuer1
07-27-2006, 04:56 AM
The first thing that I would try is preloading the image:


<script type="text/javascript">
var img1=new Image();
img1.src="popup-bagdesigns.gif";
</script>

Put that on your page before the other script.

Cliftyman
07-27-2006, 01:15 PM
That did it!

I feel like an idiot for not thinking of that one.... Thanks! :)