PDA

View Full Version : Javascript woes


jonathaw
11-20-2004, 01:08 PM
Does OSCR know? We'll see, here's my deal:
I have picture gallerys on my website (jonathanadairwilson.com/pics.php) and they are nice because you can see all the pics without reloading the page. It's a javascript I found online and modified a little. If you check the source code you can see that it uses the alt tag for a description of each pic. If you view it in internet explorer it all works fine, but in Firefox, it doesn't show that description. In fact, it just mirrors the text of the link you click on. I can't figure out why it does this, or how to fix it.
Can anyone with some javascript experience help me out? Thx.

zavala
11-20-2004, 01:27 PM
Jon,

The page looks fine from when viewed in firefox in ECE.
Either you have already fixed it, or there is some setting in firefox
that you need to lookk for.

cz

zavala
11-20-2004, 01:30 PM
Jon,

It looks like you need to check the "load images"
box found under Tools > options >Web Features.
The box is under the enable javascript box.

cz

jonathaw
11-20-2004, 10:06 PM
Hmm... my Firefox settings are all checked, and the pictures actually load just fine. It's only the captions that are a problem. For example:
If you look at my Misc. pics gallery, the first picture is "arm art".
If you use Internet Explorer and click on that link, a caption will appear below the picture of my arm that says "i was really bored one day and had a blast drawing all over my arm", which is what I obviously want to happen.
If you use Firefox (or anything besides IE, actually) it will merely say "arm art", which is just a repeat of the link that you click.

fturtle
11-20-2004, 10:19 PM
Hey Jonathan,

If you use the title tag instead of alt, it should work. IE does some nonstandard stuff with alt tags.

So, for all the images, switch alt to title, and in the script, replace all instances of 'alt' with 'title' (I only saw 2).

-Kyle

fturtle
11-20-2004, 10:22 PM
By the way, some of those pictures are pretty funny

jonathaw
11-21-2004, 11:07 AM
Thanks, that works! However, I remember that originally, the script did use title, but i changed it to alt because whenever you hover over the link, it displays the title, which is annoying if it's a long title.
It's all good though - I'm planning on redoing it with a database to hold the descriptions and other info. I like the no-reloading thing, but I think frames would be much better overall, esp. since I have it opening a new window.
Now I'm off to learn MySql...

fturtle
11-21-2004, 11:43 AM
True..

You could also use 'name' or 'id,' which aren't displayed as tooltips. Anything that Firefox doesn't ignore, really. In IE you could use a custom tag like 'caption,' but Firefox ignores stuff like that.

I agree that the database idea is good. You could combine it with the script, if you still like the script.

fischerm
11-21-2004, 11:45 AM
I like the no-reloading thing, but I think frames would be much better overall, esp. since I have it opening a new window...
noooooooooooooooo frames are the devil! THE DEVIL!

fturtle
11-21-2004, 11:51 AM
What's that you say? vBulletin is cool? Oh, I agree! :D

jonathaw
11-21-2004, 03:39 PM
As cool as vBulletin may be, my goal is to do this completely myself. To "learn". I'm in no hurry, since this is just for my own amusement.
And yeah, I guess maybe I won't use frames after all :) What I want to have is something that's pretty automated so I can just add a folder full of pics, and have some pages set up to read the filenames and allow me to enter captions for each pic and store it in a db.
I'm sure this is simple for someone that really knows what they're doing. Thanks for all the advice so far!

fturtle
11-21-2004, 05:23 PM
Ahh, heh...the vBulletin comment was for Mark. Kind of a joke.

jonathaw
11-21-2004, 08:50 PM
ok, that makes me feel better, since i didn't really get it, heh. wheeee.

jonathaw
01-07-2005, 12:15 PM
Ok, so I set out to make a web gallery without javascript, and I did.

http://www.jonathanadairwilson.com/displaygallery.php

I proud o' meself.

fischerm
01-07-2005, 01:26 PM
That's really cool Jonathan. One thing i noticed is that the location of the album list and album contents is centered vertically, and it jumps around if the height of the picture you load changes dramatically from the last one. You might think about putting a 'valign=top' line into the TD tags on those two cells, so the list will always stick to the top, no matter the height of the picture.