Fun with javascript.

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

gopunk

Lifer
Jul 7, 2001
29,239
2
0
Originally posted by: notfred
Originally posted by: rh71
it's loading both the complete image sizes of thumbnail and full image, on inital page load, correct ? If so, that could be troublesome for a gallery.

It is, and it could be a problem depending on how many images are shown per page. The loading of the large image could be moved to the point in time that the image is first clicked on, but it might not look very good. It's definitely something to look at.

why doesn't it just use the large image all the time (and adjust the size of the html element)? perhaps to reduce dependency on the browser to resize images?

in any case, it's pretty cool :) lots of innovation left to be done with javascript
 

tRaptor

Golden Member
Jul 31, 2002
1,227
1
0
Cool. Could you make a test one with 2 images? I had (little) success getting it to work with my little javascript background. I would like to see how 2 is done.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: gopunk
Originally posted by: notfred
Originally posted by: rh71
it's loading both the complete image sizes of thumbnail and full image, on inital page load, correct ? If so, that could be troublesome for a gallery.

It is, and it could be a problem depending on how many images are shown per page. The loading of the large image could be moved to the point in time that the image is first clicked on, but it might not look very good. It's definitely something to look at.

why doesn't it just use the large image all the time (and adjust the size of the html element)? perhaps to reduce dependency on the browser to resize images?

in any case, it's pretty cool :) lots of innovation left to be done with javascript

Because thumbnails load more quickly (which I realize is negated if I'm loading both images with the page) and no browser I know has a decent resize algorithm that doesn't look crappy, which means that the thumbnail sized version of a full size image looks lousy.
 

EvilYoda

Lifer
Apr 1, 2001
21,198
9
81
not a webdev, but that is still pretty sweet. but yeah, the loading would be an issue unless all the blown up pics were smaller or you limited the number of pics per page.
 

Goosemaster

Lifer
Apr 10, 2001
48,775
3
81
Originally posted by: notfred
Originally posted by: BEL6772
What happens to adjacent items? Do they slide out of the way or are they covered?

They should slide out of the way. The page would have to be designed with this effect in mind so other content didn't look funny sliding around as the image resized.

Originally posted by: MichaelD
[guy who is out of his league here] OK. You click on the pic, and it "slides, resizes" is this special? [/guy who is out of his league here]

Well, at least the pic doesn't turn into some screaming zombie thing that makes you pee your pants.

Ever seen another website use this method to show full size images from thumbnails?

Nice
 

cirthix

Diamond Member
Aug 28, 2004
3,616
1
76
Originally posted by: MichaelD

Well, at least the pic doesn't turn into some screaming zombie thing that makes you pee your pants.

heh, thats what i was expecting, but i turned the speakers down for no reason
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
Originally posted by: EvilYoda
not a webdev, but that is still pretty sweet. but yeah, the loading would be an issue unless all the blown up pics were smaller or you limited the number of pics per page.

you could probably mitigate it by loading the thumbnails first
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: gopunk
Originally posted by: EvilYoda
not a webdev, but that is still pretty sweet. but yeah, the loading would be an issue unless all the blown up pics were smaller or you limited the number of pics per page.

you could probably mitigate it by loading the thumbnails first

Yeah, if the thumbnails were all loaded, most people wouldn't care what was loading in the background.
 

Zugzwang152

Lifer
Oct 30, 2001
12,134
1
0
nice work, only downside I see on quick glance is high CPU usage, albeit only for a fraction of a second on a modern system. I would imagine the effect would be much diminished on a P2 400Mhz :p
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
Depends how it's done. If there is a higher res image being substituted it'd be useful. If it's just resizing an existing image (and as result lowering the quality) then it's kinda useless.
 

Aharami

Lifer
Aug 31, 2001
21,205
165
106
im not a web developer type...but this certainly interests me. this is very cool. I could certainly use this for my own site. did you code this?
 

Fritzo

Lifer
Jan 3, 2001
41,920
2,162
126
That's really cool. I might actually have a need for it. Can I use the code if I do need it?
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
Guess I'll be the first to say..yes I opened up the source code and took a look - pretty neat how it works, but it does slow down a little near the end on my high end system. Its a cool Idea.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Fritzo
That's really cool. I might actually have a need for it. Can I use the code if I do need it?

If you had looked at the code, you'd have your answer ;).
 

gsellis

Diamond Member
Dec 4, 2003
6,061
0
0
Forget the code, I want to know where that right is! ;)

The only issue I could see is peasants on dial-up. It might lose something while waiting for the second file.
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
Cool effect. Seems that it could make some web pages look really nice.
It'd probably be excellent for something like Ebay where you have to click on image after image to see the larger sized image.
I didn't look at your source code to see what the restrictions are... perhaps consider selling it to someone like ebay.