iPod Touch equivalent of iPhone.DomLoad

Discussion in 'Mobile Web Development' started by woody79, Aug 10, 2008.

  1. woody79

    woody79 New Member

    Joined:
    Aug 8, 2008
    Messages:
    3
    Likes Received:
    0
    The title says it all. Basically I already have
    Code:
    iPhone.DomLoad
    but the iPod Touch returns an error in the debug console.
  2. Winterboard

    Winterboard Well-Known Member

    Joined:
    Dec 26, 2007
    Messages:
    2,345
    Likes Received:
    53
    Device:
    iPad 2 (Black)
    eeeh it should work for both... I think. Try iPod.Domload

    Lol
  3. mlbplayer456_is_back

    mlbplayer456_is_back New Member

    Joined:
    Aug 4, 2008
    Messages:
    136
    Likes Received:
    0
    where do you change this ipod.domload?? i'm guessing it's in a file
  4. woody79

    woody79 New Member

    Joined:
    Aug 8, 2008
    Messages:
    3
    Likes Received:
    0
    Code:
    var updateLayout = function() {
      if (window.innerWidth != currentWidth) {
        currentWidth = window.innerWidth;
        var orient = (currentWidth == 320) ? "profile" : "landscape";
        document.body.setAttribute("orient", orient);
        window.scrollTo(0, 1);
      }
    };
    
    iPhone.DomLoad(updateLayout);
    setInterval(updateLayout, 500);
  5. woody79

    woody79 New Member

    Joined:
    Aug 8, 2008
    Messages:
    3
    Likes Received:
    0
    Basically it is in a javascript file that tells Mobile Safari to run a script on load.

Share This Page