448
צפיות
צפיות
5
תשובות
תשובות
עזרה בסקריפט JS
אהלן. לילה טוב.
<script language="JavaScript1.2">
<!–
var swidth=800
var sheight=600
if (screen.width==swidth||screen.height==sheight)
window.location=('index800X600.html');
var swidth=1024
var sheight=768
if (screen.width==swidth||screen.height==sheight)
window.location=('index1024X768.html');
//–>
איך אני מגדיר שאם למשתמש אין רזולוציית מסך שהיא אחת מאלה, הוא מופנה לדף מסויים אחר?
תודה רבה מראש!
5 תשובות
הנה קוד שבודק ומפנה בהתאם באופן מלא
<script language="JavaScript1.2">
if (screen.width=="800"||screen.height=="600")
{
window.location = "index800X600.html";
}
else
if (screen.width=="1024"||screen.height=="768")
{
window.open('http://www.nana11.co.il');
window.location = "index1024X768.html";
}
</script>
מקווה שעזרתי.
תגובה
מה ההבדל ביניהם ?
וכנראה שלא הבנת את השאלה שלי. התכוונתי איך אני עושה שאם למשתמש אין רזולוציית מסך של 800 על 600 או 1024 על 768, הוא מופנה לדף מסויים ?
ככה
if (screen.width==800||screen.height==600)
window.location=('index800X600.html');
else
if (screen.width==1024||screen.height==768)
window.location=('index1024X768.html');
else
window.location=('others.html');
תודה רבה
תשתדל לשים כותרת קצת יותר רגועה
זה לא גורם לאנשים להנס ולענות יותר… הפעם ערכתי, בפעם הבאה בבקשה תמנע מזה