javascript - Sending visitor to different page depending on window size -


I've done 3 different pages for 1024, 768 and 320 widths. What is a way to send visitors to the right page, depending on your screen resolution?

The reason for this is that I am not creating a responsive site that includes a media player that does not optimize the correct ratio: (

thanks in advance :) / excel

Window to find the height and width of the browser's window size. Use the screen object. You should do this,

  & lt ;; Doctype html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; Untitled document & lt; / Title & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Var width = screen.availWidth; // Now before comparing make sure you have only integer value width = parseInt (width.toString ()); Var path = ''; $ (Function () (if width = lt; = 320) {path = "./320.html"; load window (path);} and if (width> 320 & amp; amp; width  768 and width <= 1024) {path = "./1024.html"; load window (path);} And {path = "./1278.html"; LoadVendo (path);}}) // Here your loading function function window (path) {window.location.href = path;} & lt; / script & gt;  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -