javascript - How can I create a "view to desktop version" link on mobile site without it looping back to mobile version when it resolves? -
i've created separate mobile skin website. site serves mobile version of page based on screen size of device being viewed on using following code.
<script type="text/javascript"> if (screen.width <= 600) { window.location = "mobile/"; } </script>
i'd add "view desktop version" link @ bottom of page. naturally, above code in header of each page, detects screen size again , loops back.
could please suggest how around this. suspect session or cookie i'm new java , don't know how set these up.
thanks in advance advice.
this should handled viewport in metatag of website. use of jquery can allow users opt out of responsive design:
var targetwidth = 980; $('#view-full').bind('click', function(){ $('meta[name="viewport"]').attr('content', 'width=' + targetwidth); });
see this link more clarification.