Search Results

Search found 1 results on 1 pages for 'stucktryingtofigurethisout'.

Page 1/1 | 1 

  • How do I use the orientationchange in jQuery Mobile when working with height?

    - by stucktryingtofigurethisout
    In jQuery Mobile, I am trying to adjust the height of an image to the height of the window. The height of the window depends on the orientation of the device, but I found out that whenever I change the orientation, the height of the window that is plugged into the expressions for the height of the image is the height of the window BEFORE the orientation change! So, how do I make it so it picks up the height of the window AFTER the orientation change and then uses this new value to adjust the image height? For the code I have $(window).bind('orientationchange',function(e){ if(window.orientation == 0) { $('img').css('width') = $(window).height()*.5; } else { $('img').css('width') = $(window).height()*.6; } });

    Read the article

1