Virtual Mechanics: Community Forums and FAQs
Virtual Mechanics: Community Forums and FAQs
User's Created Tips and Insights
Opening a link in a popup window|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Honorary 'Grease Monkey' Mechanic |
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. Of course if there was a way in the future to add this code through SS, I would be VERY happy. This message has been edited. Last edited by: Barry888, |
||
|
|
Guru 'Geezer' Mechanic |
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. |
|||
|
|
Honorary 'Grease Monkey' Mechanic |
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 ! Barry |
|||
|
|
Working Mechanic |
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 |
|||
|
Guru 'Power' Mechanic![]() |
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.
|
|||
|
|
Working Mechanic |
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 http://www.octagonbaby.com/Home1.html Please help Geoff |
|||
|
|
Guru 'Geezer' Mechanic |
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.
|
|||
|
|
Working Mechanic |
Aha!
Fixed.... Thanks for your expert help once again Larry! Geoff |
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

