-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script> | ||
// Function to check if the user is on a mobile device | ||
function isMobileDevice() { | ||
return (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1); | ||
} | ||
|
||
// Check if the user is on a mobile device and load the appropriate CSS file | ||
if (isMobileDevice()) { | ||
var link = document.createElement('link'); | ||
link.rel = 'stylesheet'; | ||
link.type = 'text/css'; | ||
link.href = 'mobile.css'; // Path to your mobile CSS file | ||
document.getElementsByTagName('head')[0].appendChild(link); | ||
} | ||
else | ||
{ | ||
var link = document.createElement('link'); | ||
link.rel = 'stylesheet'; | ||
link.type = 'text/css'; | ||
link.href = 'style.css'; // Path to your mobile CSS file | ||
document.getElementsByTagName('head')[0].appendChild(link); | ||
} | ||
</script> |