3

I'm having a bit of trouble with an if statement.

I've got a little lightbox popup error message running on the site. It works fine across everything except my windows phone where the popup load at the top of the screen (apparently ie mobile doens't like absolute positioning).

My solution is to simply scroll to the top of the page to display this (but only on ie-mobile. Here's my code:

function checkiemob()
{
    if (navigator.userAgent.match(/iemobile/i))
        {
          window.scrollTo(0,0);
        } 
}    

If I remove the if statement this works fine. I've also tested the if statement with simply inserting text and that works too.

Cheers

Mark
  • 1,056
  • 1
  • 9
  • 15

1 Answers1

1

I've been working some time on Hybrid applications, and i can tell that it's not worth it if you're not CSS professional and know everything about differences in browsers.

Don't know about absolute, but maybe it will give you a hint:

position:fixed - attaches element to the specified position on the page. ( HTML standart ). Works fine in Safari and Google Chrome. But in IEmobile this position fixes the element to the display!

I think there might be same problem with you'r absloute

That means if i try to move whole page - in google and safari this fixed element will move along with the page, remaining on the same place, but in IEmobile it will stay on the same place

Developer
  • 4,158
  • 5
  • 34
  • 66