Avatar billede apo Praktikant
05. marts 2005 - 20:47 Der er 12 kommentarer og
1 løsning

Popup uden noget

Hej :-)

Jeg har dette javascript der åbner et nyt vindue ved klik på et link:

<script
type="text/javascript">
// Åben nyt vindue
function WinOpen(url,name,win_height,win_width) {
    pos_horizon = ((screen.width/2)-(win_width/2));
    pos_vertical = ((screen.height/2)-(win_height/2));
    window.open(url,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon);
    }
</script>

Spørgsmål: Hvordan får ovenstående script til kun at vise indholdet af vinduet, uden at titelbar og statusbar o.a. er synlige (dvs. således at det eneste der reelt er synligt er kanterne/rammen på vinduet)?

Apo
Avatar billede triple-x Nybegynder
05. marts 2005 - 22:02 #1
Avatar billede apo Praktikant
05. marts 2005 - 22:35 #2
Hmm... Umiddelbart lader det til at man ikke kan fjerne hverken titelbaren eller statusbaren på websider længere :-/

Kan det være rigtigt?

Apo
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 05:42 #3
http://www.dynamicdrive.com/dynamicindex8/chromeless.htm

chromeless, fjerner alt og kan sætte det op som du vil have det.

De skriver dog at det ikke virker i XP med SP1 og fremaf.. jeg har SP1 og det virker fint. :D
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 06:14 #4
ændrer den til

window.open(url,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon+", toolbars=no, location=no, directories=no, menubar=no, resizable=no");

så virker den, det virker i hvertfald hos mig. :D
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 06:17 #5
har testet den i firefox, der virker den også. :D

smider som svar. :D
Avatar billede apo Praktikant
06. marts 2005 - 10:39 #6
blackscorpion > Jeg takker for forslagene, men ingen af dem virker hos mig (XP og SP2) - Uanset hvad jeg prøver, er titlebar og statusbar hele tiden synlige :-/

Jeg gætter på at det er Bill G og hans indianere der har besluttet sig for, at ødelægge muligheden for at lave popup-vinduer med et pænt design, så jeg vælger derfor at lukke spørgsmålet helt :-(

// Lukker

Apo
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 16:34 #7
og du kan ikke bruge chromeless?
Avatar billede triple-x Nybegynder
06. marts 2005 - 16:36 #8
blackskorpion - den jeg linkede til virker også ;) men de virker ikke længere med SP2
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 16:49 #9
triple-x -> ahh okey, men kan se at din skriver =0, istedet for =no. :D
Avatar billede triple-x Nybegynder
06. marts 2005 - 16:52 #10
hehe skal ik kunne sige om det har nogen betydning :) men ingen af dem virker vidst med SP2
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 16:57 #11
okey underligt, på chromeless, står der fra SP1, og det virker fint med mig. *GG*

Men der må være noget man kan gøre for at fjerne dem i SP2. :D
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 17:10 #12
Browser Window Restrictions
Does your Web site position windows so that the title bar or address bar is above the visible top of the display, or the status bar is below the visible bottom of the display?
Review your code to ensure you understand the restrictions now in place for script-initiated windows using the window.open() or window.createPopup() methods. The script can call the same methods for the creation of an Internet Explorer window with chrome (using the window.open() method) or an Internet Explorer chromeless pop-up window (using the window.createPopup() method). However, the design might need to be reviewed to ensure that pop-up windows are appropriately visible to the user and that the status bar contains accurate information.

The following are guidelines for working with script-initiated window calls in a process running the Windows Restrictions Security feature.

For windows opened using window.open():

Expect the status bar to be present, and code for it. The status bar will be on by default and is 20-25 pixels in height.
Adjust your window's size and content so that it will fit well visually with the window's overall size. The window will not cover the taskbar, so it might lose 40 pixels if the status bar is on and the taskbar is not accounted for. Vertically size the window no more than 30 pixels outside the taskbar.
Do not open windows off-screen—they will be moved by the smallest offset of X and Y coordinates that allows the window to fully display on-screen.
As before, the display of the window will be affected by the display theme, font size, and resolution, so you might also need to account for these UI influences when you are designing your windows.
Note: window.open() with fullscreen=yes will now result in a maximized window, not a kiosk mode window.
For windows opened using window.createPopup():

Adjust the window's size and content so it will fit well visually with the window's overall size. With this new feature, the window will not cover its parent window's title bar or status bar, so it might lose 40 pixels if the title and status bars are not accounted for. Vertically size the window no larger than the currently visible area of the page.
Do not open chromeless windows outside the HTML rendering surface of Internet Explorer—they will be moved by the smallest offset of X and Y coordinates that allows the window to be fully displayed inside the client area. There is one exception: up to half of the window can exist outside the left or right edge of the Internet Explorer client area.
As before, the display of the window will be affected by the display theme, font size, and resolution, so you might also need to account for these UI influences when you are designing your windows.
General Tips
Detecting Internet Explorer in SP2
You can use window.navigator.userAgent to detect if the browser connecting to your site is Internet Explorer in SP2.

var g_fIsSP2 = false;
function browserVersion()
{
  g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
  if (g_fIsSP2)
  {
  //This browser is Internet Explorer in SP2.
  }
  else
  {
  //This browser is not Internet Explorer in SP2.
  }
}
If the user agent string contains "SV1", the browser connecting to your site is Internet Explorer in SP2.
Avatar billede blackscorpion Nybegynder
06. marts 2005 - 17:11 #13
lidt læsning. slog det op på:
http://msdn.microsoft.com/security/default.aspx?pull=/library/en-us/dnwxp/html/xpsp2web.asp

Der er en hel del mere at læse om, bla. downloads osv. :D
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester