开发者

Different response by screen solutions using Django and jQuery

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?


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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜