The fade doesn't work in FF, but danged if it doesn't rock in IE.
I didn't even know it was possible for javascript to do this stuff.
*playing around with code to figure it out*
//edit. Damn, now I'm a lot more confused. I don't want to have IE or FF resize my images to thumbnails, for the sake of loading, skewing, and cause I want to crop the thumbnails myself. So, I want to click on a thumnail, have that thumbnail go grey, and switch the image. *cries*
*still playing around with code, seems to be making a little more sense*
[web] Photo album and javascripting
Quote:The fade doesn't work in FF, but danged if it doesn't rock in IE.
Oops, my fault. Should be img_opacity / 100 instead of img_opacity / 10.
Internet Explorer uses a range of 0-100, FireFox uses 0-1.
Quote:I don't want to have IE or FF resize my images to thumbnails, for the sake of loading, skewing, and cause I want to crop the thumbnails myself.
Well, ofcourse you don't want that. It was just easier for me to make that code snippet.
In my example, it takes the url of the thumb image to change the url of the large image. You could change the functions a little, and parse the url of the full image (removed most of the original code):
<img src="thesmallimage.jpg" onclick="switch_large_image('urloflargeimage.jpg', 'some text')"><script language=javascript>function switch_large_image(url_of_that_really_large_image, text_to_display){ img.src = url_of_that_really_large_image; txt.innerHTML = text_to_display;}
Quote:*cries*
*shocked, suddenly realizes he made God cry*
Quote:still playing around with code, seems to be making a little more sense
Good. I'll have to call it a night, so I won't be able to answer any question for the first eight hours or so. Good luck!
Okay, so the basic code is simple...
...and that is about the extent of it that I understand. The fade seems prone to being buggy (initial click, fast clicking), and quite honestly, I'm not going to be able to figure it out, and I don't want you to have to write code for all the eventualities [grin]. But I would love to figure out how to fade the thumnail that gets clicked, and to un-fade the previous one
<img src="large1.gif" id="img"><div id="txt">original text</div><br><br><img src="small1.gif" id="tn1" onclick="switch_image('large1.gif', 'sally1');"><img src="small2.gif" id="tn2" onclick="switch_image('large2.gif', 'sally2');"><br><br><script language=javascript>function switch_image(url, text){ img.src = url; txt.innerHTML = text;}
...and that is about the extent of it that I understand. The fade seems prone to being buggy (initial click, fast clicking), and quite honestly, I'm not going to be able to figure it out, and I don't want you to have to write code for all the eventualities [grin]. But I would love to figure out how to fade the thumnail that gets clicked, and to un-fade the previous one
But thank you so much, wanmaster [grin]. I'll see if I can figure out the rest of it tonight [grin].
Is there any support for the fade command in Safari for macs?
If not, that's cool - the fading isn't necessary like the image switching is (which works just fine).
And now that I'm a little calmed down, I think I can figure out the rest of the code...
-Avatar God, who can't remember his login info
If not, that's cool - the fading isn't necessary like the image switching is (which works just fine).
And now that I'm a little calmed down, I think I can figure out the rest of the code...
-Avatar God, who can't remember his login info
You might want to try the opacity CSS attribute. It's defined for CSS3 (see here) and there might already be some support for that under Safari/Opera. It's the same as Mozilla/Firefox -moz-opacity except for the -moz- prefix. Mozilla has a tendency to prefix CSS3 attributes with that (presumably because CSS3 isn't a W3C recommendation yet so the specs could still change).
Cool, I'm still working on the opacity stuff, but I at least put up the other part.
edit - no, I haven't uploaded it, lol.
edit - no, I haven't uploaded it, lol.
Quote:Original post by Avatar God
Cool, I'm still working on the opacity stuff, but I at least put up the other part.
edit - no, I haven't uploaded it, lol.
*still waits anxiously, does not dare to go offline and miss the grand opening*
[lol]
Well, I feel dumb right now. I can't figure out how to adjust the style of my div bar for the text. Is there some trick to it that I don't know...?
That is, I'd like to slap a class="phototext" on it and mess with it's CSS styles, but that doesn't seem to work...
Oh, and I removed the opacity stuff from that version, still don't have it all down yet.
*Is glad GDNet doesn't show the pathetic number of edits I make to each post*
That is, I'd like to slap a class="phototext" on it and mess with it's CSS styles, but that doesn't seem to work...
Oh, and I removed the opacity stuff from that version, still don't have it all down yet.
*Is glad GDNet doesn't show the pathetic number of edits I make to each post*
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement