[thelist] Javascript minimize

Keith cache at dowebscentral.com
Sat Mar 2 09:51:01 CST 2002


> Hey I have site that opens up in a chromeless window. Now I would like
> users to be able to close/minimize the window whith some icons I have
> created. The close is easy but does anyone know how I can do the
> minimize?? IT is safe to assume that it only has to work on IE on a PC
> platform.
>

To minimize chromeless windows I send the window 2000px off
screen. Clicking on the window's button in the task bar will give
focus to the window even if it is offscreen, so an onfocus in the body
tag  responds by moving the window back 2000px to where it was
at.  The trick is to keep track of whether the window is offscreen or
not because you don't want onfocus to move it everytime the
window gets focus.

on the page in the chromeless add onfocus=reshow() to the body
tag

Then create a minimize button on the chromeless that calls
minimize()

<script>
show=1
function minimize(){
  moveBy(2000,2000)
  show=0
}
function reshow(){
  if(show==0{
    moveBy(-2000,-2000)
    show=1
  }
}
</script>

I've converted some of my chromeless windows to .hta since both
use IE as a workspace. In .hta mode the window may be the only
window open since it is running as a windows app. This is the only
way I've found to fake a minimize when the window is the only thing
on the screen


keith



More information about the thelist mailing list