views:

359

answers:

2

Hi,

Is it possible to in a situation like this;

<li><a href="javascript:productPop('includes/products/test.php','8 mil');">asadfasdf</a></li>
<li><a href="javascript:productPop('includes/products/test.php','15 mil');">asdfasdf</a></li>
<li><a href="javascript:productPop('includes/products/test.php','hello');">asdfasdf</a></li>

to have the windows open in a cascade? So that the user can compare windows side by side.

Other relevant code

var newwindow;
function productPop(url)
{
    newwindow=window.open(url,name,'width=560,height=340,toolbar=0,menubar=0,location=0');
    if (window.focus) {newwindow.focus()}
}

EDIT:

Or please suggest a better way to accomplish the same thing

+1  A: 

If you really want to do that, set the locations of the popups with javascript. May I ask why you are using popups? There are many other, less annoying ways of displaying information.

Dan
Thanks for the suggestion but the location thing doesn't seem to work.
Vian Esterhuizen
Hatdrawn: I reckon Dan means the window positions. Each subsequent window is open relative to the previous window position.
vit
+2  A: 

It's technically possible although getting them to line up consistently will be challenging.

As Joel suggested, it's not desirable in terms of usability.

For side-by-side comparisons, have you considered a single page that allows them to add and remove items for comparison?

One implementation I'm familiar with is at http://www.fueleconomy.gov/feg/findacar.htm - but there are probably better ways of achieving this goal.

EDIT: As requested, I think your code is almost there. Might add the name parameter - if the name doesn't change it won't open a new instance of a window with each call (I'm assuming you fixed this already based on your HTML).

var newwindow;
function productPop(url, name)
{    
   newwindow=window.open(url,name,'width=560,height=340,toolbar=0,menubar=0,location=0');  
   if (window.focus) {newwindow.focus()}
}
Mayo
I have thought of many different ways. But not only does the client specifically want windows that pop up but he also doesn't want to pay for the time it would take to develop that. They don't have to line up next to each other, I just want both windows to stay in front of the browser. As it is now, when you open a new window the previous window gets sent to the far back
Vian Esterhuizen
Sometimes users ask for things because they don't know of a better way. Maybe they don't like the postback effect that the figure is mandatory when adding new items? AJAX would fix that. Of course, you can't do much about them not wanting to pay for something better... :)
Mayo
Yes, I know everything that everyone is lecturing me on. I tried to convince him of another way, but if this is what he wants, this is what he wants. I appreciate the feedback but could you please tell me the "technically possible" way to do this. Clearly this isn't the best client, so I'd just like to give him what he wants and have it over with. Please and thank you.
Vian Esterhuizen