Solved

Window link no scroll, no toolbar

Posted on 2004-09-18
2
832 Views
Last Modified: 2010-05-18
I have an image on my page when I click the image I want it to open new window with no toolbar, not scroll bars, and I want to set the size of the window.

I found this code but I'm not sure how to make it work for an image:

<a href="#" onClick="window.open('your link','link name','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=150,left=150,width=450,height=300')">'link name'</a>
0
Comment
Question by:antonyeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 12094748
Yes, the code you quoted should work fine.

If you're image is for example images/fullimage1.png with size 400x600 you would then use something like the code below:
I like to have somekind of function in a <script></script> body, because you then would not have to rewrite the whole window.open thing in every hyperlink and your code becomes somewhat cleaner.
<script type="text/javascript">
function showImage(imgUrl, height, width)
{
window.open(imgUrl, 'fullImage', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=' + width + ',height=' + height);
}
</script>

<a href="#" onClick="return showImage('images/fullimage1.png', 400, 600);">See full image</a>
<a href="#" onClick="return showImage('images/fullimage2.png', 430, 600);">See full image</a>

By using the 'fullImage' linkname in your window.open command, you also prevent from opening multiple popups. When one popup is opened, the next image will open in that popup. We could then do something with focus etc, but first check this works like you want it to work.
0
 
LVL 14

Accepted Solution

by:
boonleng earned 500 total points
ID: 12095449
I think this is what you are looking for, just put the image tag inside the anchor tag:

<a href="javascript:void(0)" onClick="window.open('http://www.experts-exchange.com','popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=150,left=150,width=450,height=300')"><img src="http://www.experts-exchange.com/images/certification.gif" border="0"></a>

Use "javascript:void(0)" instead of "#" for the link so that browser wont execute it.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Obtaining data on ASP 8 36
Debugging Html 8 32
CSS Style on Chrome 1 39
Use Mid in Html 6 22
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

733 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