Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

window.open

Posted on 2011-10-06
8
Medium Priority
?
366 Views
Last Modified: 2012-05-12
I have am using the window.open script below it is link to difrent pictures. my problem is that if i open one an minimize it when i click on another one it will just refresh the same minimize one. How do i make it open on the same window but bring it active / to the screen.

<script language="JavaScript"> 
var links = new Array("http://theonlinebeatz.com/Music/IBachata.html","http://theonlinebeatz.com/Music/Isalsa.html",
                        "http://theonlinebeatz.com/Music/I80.html","http://theonlinebeatz.com/Music/Iclub.html",
                        "http://theonlinebeatz.com/music/Isoul.html","http://theonlinebeatz.com/Music/Ihiphop.html",
                        "http://Theonlinebeatz.com/Music/Iclasic.html", "http://theonlinebeatz.com/Music/IDisco.html",
                        "http://theonlinebeatz.com/Music/Ireggeaton.html","http://theonlinebeatz.com/Music/IPOP.html",
                        "http://theonlinebeatz.com/Music/ISPanishRock.html","http://theonlinebeatz.com/Music/IFreeStyle.html");
function new_win(pagetype)
{
    window.open(links[pagetype-1],"Playlist","width=300,height=210,screenX=50,left=50,screenY=50,top=50,status=yes,menubar=yes,resizable=no");
}
 
</script>

Open in new window

0
Comment
Question by:Zirwo01
  • 5
  • 3
8 Comments
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 36925276
javascript cannot minimize or maximize windows in the sense you are talking.  If a window is minimized, it will stay minimized.  You can alter window sizes, but not minimize.
0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 36925285
Adn the reason why it is opening in the same window is because you are naming it the same thing.   IF you change the name every time then it will open in a new window.  Not sure if that is what you are looking for though.
0
 

Author Comment

by:Zirwo01
ID: 36925538
what about bring it active/to the front if is behind another window?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Assisted Solution

by:CCSOFlag
CCSOFlag earned 2000 total points
ID: 36925550
aye window.focus() will do that.
0
 

Author Comment

by:Zirwo01
ID: 36925587
where do i put this? can u post the code?
0
 
LVL 9

Accepted Solution

by:
CCSOFlag earned 2000 total points
ID: 36925595
Sure no problem.

function new_win(pagetype)
{
    myWindow = window.open(links[pagetype-1],"Playlist","width=300,height=210,screenX=50,left=50,screenY=50,top=50,status=yes,menubar=yes,resizable=no");
     myWindow.focus();
}
0
 

Author Closing Comment

by:Zirwo01
ID: 36925671
Thanks!
0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 36925739
NP glad to help. :)
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to dynamically set the form action using jQuery.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question