Search code examples
jqueryresizeautoresize

How can I make my slideshow resize with the window?


I'm using the jQuery slideshow plugin in a fluid layout. However the plugin sets the width of the DIVs on load. If the user resize the browser window the slideshow remains the same size... not so big a deal when increasing the window size, but if they decrease it the slideshow bleeds over top of other columns.

How can I make the slides (each is a div) resize when the browser is resized?


Solution

  • This is not specific to your slideshow plugin. But the function you're looking for is

    $(window).resize(function() {
        //This is where you resize your divs.
    });
    

    This should work fine for the resizing of the divs. But without knowing anything about your plugin it may be that you have to redraw the slideshow after the resize. Look into the API specifications of the plugin to find a function that does something like that.