PDA

View Full Version : Dynamically loading different sized images based on browser size?


owen-b
11-16-2008, 09:28 PM
Hi all,

This has probably been asked before but all the search terms I tried turned up zero results, so apologies in advance if so!

What I would like is to be able to load one of two versions of an image based on the size of the browser window to make use of the larger screen 'real estate' many people have these days, while not abusing those on smaller screens.

I imagine this would take a combination of Javascript and either uploading two images, or an add-on that can take a large image and downscale it. Presumably the latter as I don't know of a way to upload two seperate images to Pixelpost for one post.

Any ideas? I'm VERY keen to implement this.

jaywilliams
11-17-2008, 06:53 PM
After a LOT of hard work, and a lot of custom addon code by both me, and a friend of mine, I have set my photoblog to do this very thing. The main problem is, as you guessed, is the complexity setting it all up. But once you have a system which works, it basically runs itself.

As you can see here: http://photoblog.dview.us/

Feel free to check out the Javascript code I use on my site, perhaps you can use some of it for yours!

If you aren't a programer, and don't want to get your hands dirty with a bunch of code, you may want to pay someone to setup a system like this. My friend would probably be willing to do it for you, as long as he gets a little monetary incentive. ;) PM me and I'll put you in contact with him.

Hopefully that helps you in your quest!

owen-b
11-18-2008, 11:43 PM
Well, I'm not a coder but I know my way around the HTML and CSS files of my site, although not the PHP stuff that runs behind the scenes, and can install Javascript if I know where to put it etc.

Any chance you could spare some time to talk me through what you did so I can see if it's something I can attempt to duplicate myself? :)