Log in

View Full Version : Open new window minimized?



Raged
12-08-2005, 07:48 PM
can some1 please give me a code i can use to load a html minimized

jscheuer1
12-08-2005, 10:03 PM
There is no HTML code for that. This javascript may be put in the head of the page:


<script type="text/javascript">
onload=self.blur();
</script>

But, since it is javascript, only javascript enabled browsers will use it. And since the browser can usually only blur() a window in relationship to (an)other open window(s) in that browser session, it is best if the page that this script is on is opened using the target="_blank" attribute or the javascript window.open() method from the calling page. Example1:


<a href="minimized.htm" target="_blank">Link Text</a>

Example2:


<a href="minimized.htm" onclick="window.open(this.href);return false;">Link Text</a>

Some browsers, like Opera for example, that treat new windows as new tabs may react oddly to this strategy, as may a browser (like FF) that allows the user to choose 'open link in a new tab' by right clicking on a link and selecting that option, if chosen.

Added:
I just tried this out, and the tabbed browsers handled it well, they open the new tab and shift focus to the calling tab.

jesse
12-10-2005, 08:15 PM
Do not do this, nobody wants popups let alone to be minimized.
Sounds like a popup ad compaign :(