עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[JS / PHP] התאמת החלון לתוכן שלו

Featured Replies

פורסם

יש לי דף שממנו יש קישורים לסרטוני וידאו.

ואני רוצה שכל סרטון יפתח בחלון חדש, אבל אני רוצה שהוא יהיה בדיוק בגדול של הסרטון.

ניסיתי עם javascript ופונקציית ה resizeto, אבל זה משנה את הגודל של כל החלון (ביחד עם הטולבארים והכל).

אפשרות שחשבתי עליה היא להעלים את הטולבארים ואז לשנות את הגודל של החלון. אבל לא מצאתי איך אני מעלים את הטולבארים בחלון שכבר פתוח.

*המידות של הסרטון קבועות וידועות לי.

יש אפשרות אחרת בJS או בPHP לעשות את זה?

פורסם

php זאת שפה שרצה על השרת כך שאין שום קשר בין השניים

מן הסתם שאתה אמור לעשות את זה ב js

מצורף קוד דוגמא


<script type="text/javascript">
function wopen(url, name, w, h)
{
w += 32
h += 96
var win = window.open(url,
name,
'width=' + w + ', height=' + h + ', ' +
'location=no, menubar=no, ' +
'status=no, toolbar=no, scrollbars=no, resizable=no')
win.resizeTo(w, h)
win.focus()
}

</script>

את החלק הזה אתה דוחף בתור הקישור



<a href="page.html" target="popup" onClick="wopen('page.html', 'popup', 640, 480); return false;">זה הקישור שלך</a>

מקווה שעזרתי.

פורסם

DarkSight, למה אתה מוסיף דווקא 32 לגובה ו96 לרוחב איך הגעת למספרים האלה?

פורסם
  • מחבר

ואם החלון כבר פתוח, אפשרי להעלים את כל הטולבארים?

פורסם

זה אמור לפתוח בלי toolbar

אם תסתכל טוב תראה יש פרמטר כזה בפונקציהwindow.open

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.