Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Honorary 'Grease Monkey' Mechanic
Picture of Barry888
Posted
Hi Guys !

Just a tip in case you need to open a link in a popup window.
There are several ways to do it and I found this way to be the simplest and it worked best for me :

<A HREF="mywebpage.html" onClick="window.open('mywebpage.html','Window1','width=340, height=255, left=150, top=250, scrollbars=no, resizable=no'); return false" target="_blank">

'Window1' = choose here a name for the popup
'width' and 'height' = size of the popup (in this case I put the size of my photo)
'left' and 'top' = position of the popup inside the screen
'scrollbars' and 'resizable' is no if it's only an image popup
return false allows the image to be open in a full new window if any browser is not compatible

I tried this command with IE and Firefox without any problem. It works perfect.

For the moment I will add it with an external editor but I will have to redo the modifications every time I modify my SS source. Confused

Of course if there was a way in the future to add this code through SS, I would be VERY happy. Smile

This message has been edited. Last edited by: Barry888,
 
Posts: 356 | Location: Ningbo, China | Registered: April 15, 2006Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
Barry,

If you use the Object Editor Tool, you could accomplish the same thing without using an external editor.

Under the Link tab, use a blank Link Type, and a place-holder ("#") for the URL. Then in the Code field enter your code:

onClick="window.open('mywebpage.html','Window1','width=340, height=255, left=150, top=250, scrollbars=no, resizable=no'); return false" target="_blank"

You do not need to check the option "Open this link in a new window" since your code already will do this.

This will relieve you from using an external editor to add the code to your published projects.
 
Posts: 5064 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Grease Monkey' Mechanic
Picture of Barry888
Posted Hide Post
Hi Larry !

Yes you're pretty right ! Thanks for your answer !!!
I think your post will be useful for lots of other people too !

See you ! Smile

Barry
 
Posts: 356 | Location: Ningbo, China | Registered: April 15, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
Hi,

I'm trying to do this. (make the popup smaller than the page it's opening up on top of)
What do you put in the place of "mywebpage.html"?
Is it just the website URl or the full path of the actual page?, ie: www.mywebsite.com/sizechart.html
 
Posts: 34 | Location: Ottawa, Canada | Registered: November 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Power' Mechanic
Picture of Bruceee
Posted Hide Post
If the page you are displaying is off-site, then you have to use the full URL that you have given. However, if it is a page on your site, then "sizechart.html" is preferable, although the full URL will still work.
 
Posts: 9208 | Location: Wellington, New Zealand | Registered: December 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
Hi again Bruceee,

I had this working perfectly, then I had to redo my page an I can't get it to work again. I've included the page where the link is. It's the "Size Chart" link and I want it to open a smaller "size chart" page on top of the current page. For some reason, it's opening another "Home1" page.. grrrrr Frown

http://www.octagonbaby.com/Home1.html

Please help
Geoff
 
Posts: 34 | Location: Ottawa, Canada | Registered: November 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
You have 2 targets for the Size Chart link: one is an onClick event and the other looks like a standard text link. You need to remove the text link in order to let the onClick code work.
 
Posts: 5064 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
Aha!
Fixed....

Thanks for your expert help once again Larry!

Geoff
 
Posts: 34 | Location: Ottawa, Canada | Registered: November 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.