Change div order to suite responsive viewport

Total Post:88

 1397  View(s)
Rate this:
Im using the script below to change the order of two divs - my document's html has the div class "imagepanel ip-middle" preceeding the div class "bgimagescale image2". When viewing on a viewport smaller than 768px wide - I want the divs reversed. The script below does not reverse the divs on page load. Only on resize - as I guess the script indicates!: .bind("resize", listenWidth). I have been unable to locate the right way to change the order of the divs using jquery on page load as well as resize. Many thanks.

<script type="text/javascript">
jQuery(document).load($(window).bind("resize", listenWidth));
function listenWidth( e ) {
    } else {
  1. Post:51

    Re: Change div order to suite responsive viewport

    Use load and resize together, something like this:

    $(window).on("load resize",function(e){

      Modified On Apr-07-2018 06:01:25 AM



Enter your email address here always to be updated. We promise not to spam!