views:

105

answers:

1

In a thumbnail website, if I want to display 100x100 thumbs on screnn resolutions lower than 1280x1024 while display 150x150 thumbs for screens higher than 1280x1024, is the following procedure correct?

  1. Render a page frame with no thumbs by view1()
  2. On page frame loaded, it detects client's screen resolution and pass it to another Django view call fetchthumb()
  3. View fetchthumb() create html code containing the thumb images and return to page frame.
  4. jQuery on page frame render thumb html on browser.

Are there any better methods?

+2  A: 

i think you have few options

  1. Just change thumbnail at runtime based on $(window).width(); using jquery
  2. Pass on screen resolution to django first time from client side, and later store it in session and render templates accordingly
  3. Sometime you may get screen resolution in request headers, i am not sure though
  4. Best would be to design a general solution which doesn't depend on screen resolution, and scaling 150x150 to 100x100 shouldn't be a problem on client side.
Anurag Uniyal
option one makes sense, just let jQuery chooses whether to display image100x100.jpg or image150x150.jpg at runtime.
jack
for option two, we mainly need to display 100x100 thumbs on homepage for low screen resolutions, larger thumbs take too much space thus limits the content users can see on screen. so we just need a solution to pick corresponding template on first visit.
jack
jack, create your page fluidly so the thumbs will fit in the area you want them.
Brandon H