Asynchronous content for mobile

Asked

Viewed 14 times

1

I am working on a new website project, where some areas will need a special html treatment for presentation. For example: for the desktop, we have a 1920x800 image carousel, while on mobile, I want to work with a 768x1024 carousel.

They are different images and not to overload the load, I would like to deliver the correct version for each access device [mobile, desktop]

My idea was to use asynchronous loading via javascript, where I detect the window.width and check if the screen is larger or smaller than 1024px. From this result, I search via ajax the appropriate html content.

I would like to know if you know/know of other means to reach this result. Thank you!

  • Use bootstrap but the name of what you want specifically is called 'css media query'

  • 1

    You should see was the width of the device (768px) and not the height. That is, see if it is less than or equal to 768px.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.