function dynamicViewport() {
var currentScreen = screen.width;
$('meta[name="viewport"]').remove();
if (currentScreen <= 640) {
$('<meta name="viewport" content="width=640">').appendTo('head');
} else {
$('<meta name="viewport" content="width=device-width">').appendTo('head');
}
}
document.addEventListener("DOMContentLoaded", dynamicViewport);