So I am loading in different javascript depending on the screen width. The script is simple and works fine and loads the appropriate script depending on screen width. The problem is it only loads in the script depending on the original screen width. If i change my screen width to be smaller it doesn't change unless i refresh the page.
Anybody know of a simple fix? I am still pretty nooby with javascript.
Thanks!
Code im using:
if( $(window).width()>1280){//Add your JavaScript for large screens here}elseif( $(window).width()>768){//Add your JavaScript for medium screens here}else( $(window).width()>439){//Add your JavaScript for small screens here}
China wants the tech... if they were to invade, TSMC would destroy it's fabs and other critical information first. Plus, you can bet they have backups stored NOT in Taiwan.
You totally missed what I was saying. Yes, the DHCP server software is largely unchanged since the Windows 2000 Server version. My statement was somewhat of a joke, but I was saying that *IF* the DHCP server was written using today's Windows 11 *ERA* design philosophy, it would be a mess. Yes, even on the latest version of Windows Server it still uses the old software, but that wasn't really the point.
Ole Carl "One Plus One" Pei at it again. Surprised he didn't used the "invite" again.
The company had previously noted that it would need to sell at least 250,000 units to break even.
Question
PortalPacific
So I am loading in different javascript depending on the screen width. The script is simple and works fine and loads the appropriate script depending on screen width. The problem is it only loads in the script depending on the original screen width. If i change my screen width to be smaller it doesn't change unless i refresh the page.
Anybody know of a simple fix? I am still pretty nooby with javascript.
Thanks!
Code im using:
Link to comment
https://www.neowin.net/forum/topic/1229631-loading-different-javascript-depending-on-window-size-with-if-and-else-statements/Share on other sites
14 answers to this question
Recommended Posts