?
Solved

Window link no scroll, no toolbar

Posted on 2004-09-18
2
Medium Priority
?
842 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 2000 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

766 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