Solved

Window link no scroll, no toolbar

Posted on 2004-09-18
2
829 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use embargo Date/time in php 29 39
Put shading on half of picture 8 43
Easy responsive table out of existing table 28 55
Javasctipt 2 26
Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

803 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