[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

href question

I want to have a link open in a new window. This is what I've currently got:

<a href="#" onClick="MM_openBrWindow('http://www.domain.com/file.html','Name','status=yes,scrollbars=yes,width=600,height=400')">

The problem is that "#" reloads the page and displays it at the top, a bit annoying if this link is further down the page, and visitors need to re-scroll down to find this section. Is there any way to get around this?

Also, Is it possible to have the pop-up window centered on the clients' page, regardless of screen resolution?
0
mpaert
Asked:
mpaert
  • 9
  • 6
  • 5
2 Solutions
 
LakioCommented:
<a href="#" onClick="MM_openBrWindow('http://www.domain.com/file.html','Name','status=yes,scrollbars=yes,width=600,height=400'); return false">
0
 
mpaertAuthor Commented:
Thanks Lakio. Any ideas about positionling the pop-up centrally?
0
 
mpaertAuthor Commented:
Slight change of plan, I'm using this for the description of an eBay auction, and, as it seems, eBay won't let me have a pop-up window. So far, the only thing I've been able to do is to open a link in a new window.

See http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=9704972035# - In the "VPS Value" section you can see "Upgrade Options". Under that header, you have two "[Details]" links. These links are supposed to display a new window with information. As I'm not able to have those, has anybody got any good suggestions on how or which HTML to use so that visitors can press the [Details] link and get informtaion on those upgrades...
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LakioCommented:
you can have a layer with all the info or just open in a new window
0
 
mpaertAuthor Commented:
THanks, but I wasn't able to have a layer displaid at all on ebay, they're very careful with which code can be used on their site.... I guess then it's just a link in a new window....
0
 
mpaertAuthor Commented:
This is maybe the wrong forum, but maybe CSS can solve this???
0
 
ZylochCommented:
I took a quick look at the Ebay standards and you may be able to work with the layers.

Just have something like this:

href="#" onclick="document.getElementById('det1').style.display=(document.getElementById('det1').style.display=='none')?'':'none'; return false;">

and then have

<div id="det1" style="border:1px;display:none;">
Your Details
</div>

for each detail, changing det1 in both the Javascript and id
0
 
LakioCommented:
well, all you can do with css is show text on mouseover, but really if its not your page then just open a new window

(you can open a window(1) and then with it open a popup(2) then closes (1) but I really think that a bad idea)
0
 
ZylochCommented:
I'd echo what Lakio said; with SP2, it's not even a guarantee the new window will open -_-
0
 
LakioCommented:
if Zyloch thing works use it, or just open a normal window
0
 
mpaertAuthor Commented:
Zyloch, you're a genius.

See http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=9704972035 and find the "Layer Test Link"

Could I have many "links" that point to the same layer, would I in this case just keep the same ID?
0
 
mpaertAuthor Commented:
Sorry, another question. Do you know if it is possible to source the contents of a layer from another file without using iframes etc? I have 13 pages, all using the same layer contents. If I need to change one, I have to do it on all 13 manually... a bit of a pain...
0
 
ZylochCommented:
I'm afraid I know no easy way of doing so. Anything possible with Javascript (namely with xmlhttp) would most likely meet with a permission denied error since you cannot cross-site script.

However, you can have another link point to the content by using the same id in the Javascript.
0
 
LakioCommented:
lol, I like the open a new page thing :)
0
 
ZylochCommented:
It depends on how you use it :D There's certainly nothing wrong with the new page, and you can even make it look nice, perhaps by centering the information and providing a close button :)
0
 
mpaertAuthor Commented:
Thanks guys, the page looks much better now, with no navigation out of it for viewing the [Details] part. Any more suggestions how to present it better?
0
 
mpaertAuthor Commented:
umm, I must have been writing whilst you submitted your message.

Can the text "Close" appear after one has clicked "Details"?
0
 
ZylochCommented:
Ah, I see. Sure, just have this:

onclick="var d=document.getElementById('det1');if (d.style.display=='none'){d.style.display='';this.innerHTML='Close';}else{d.style.display='none';this.innerHTML='Details';} return false;"

As always, change 'det1' to what is needed.
0
 
mpaertAuthor Commented:
Done. Thanks so much.
0
 
LakioCommented:
mpaert its looking good :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 9
  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now