-2

Does anyone know if it is possible to create a website that scrolls across five panels horizontally yet still remains responsive? I can make it work for a specific viewport size by creating an outer div that contains a div with the five different screens extended across. I use javascript to set the max-width of the viewport div and the width of each section, but if the browser is resized, or the device orientation is changed, it doesn't 'respond', you would have to reload the page. Does anyone have any insight on this?

1
  • $(window).on('resize', resize); - then drop all your js resizing stuff into a resize function.
    – Kai Qing
    Oct 14, 2014 at 23:22

1 Answer 1

0

You can adjust the resizing function on window resize instead of on load...

this is assumed to be placed in the window load event, however you choose to set that. ($(document).ready() for example)

function resize(){
    //do whatever you do on resize here
}

//set the listener and call the function initially
$(window).on('resize', resize);
resize();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.