jquery - Javascript on load event -


hey guys i'm new , i'm having problem meta tag.

i'm trying create mobile website iphone interface.

the problem though viewport meta tag not function on site.

i decided use javascript code works gesture activated meaning script not function until user zooms in bit on screen.

code's below, see if can help.

thanks.

    <script type="text/javascript"> (function(doc) {      var addevent = 'addeventlistener',         type = 'gesturestart',         qsa = 'queryselectorall',         scales = [1, 1],         meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];      function fix() {         meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];         doc.removeeventlistener(type, fix, true);     }      if ((meta = meta[meta.length - 1]) && addevent in doc) {         fix();         scales = [.25, 1.6];         doc[addevent](type, fix, true);     }  }(document)); </script> 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -