[resolved] How to add a image that opens in a new window (7 posts)

  1. domesticlife
    Posted 10 years ago #

    I have a daily cartoon that I would like to open in a new window when someone clicks on the link. The main reason is because it is too wide for my site design and messes up the sidebar. I'd be greatful for any help.


  2. toughIQ
    Posted 10 years ago #

    do you mean, for example, to add a java script to open images on click?

    i added the following code to my headers file.

    <SCRIPT LANGUAGE="JavaScript">
    function zoom(img, w, h) {window.open(img,'zoom'+w+h,'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width='+w+',height='+h);}
    // -->

    when posting, i add the following as link to the image:

    <a href="javascript:zoom('http://url.to/large_image.jpg', 200, 300);" onmouseover="self.status='Zoom In';return true">

    the parameters are: image location, width (in pix), height (in pix).
    the mouse over thing is for not showing off the javascript link in the status bar of your browser.

    an example can be found at: My Blog

    hope this is, what you where looking for.

    bye, chris

  3. twoalone
    Posted 10 years ago #

    thank you!!!!!!!!!! i spent hours last night looking for this exact thing.

  4. Beel
    Posted 10 years ago #

    You'll need to change the script language stuff (and uncapitalize it) in order for the page to validate.

  5. toughIQ
    Posted 10 years ago #

    thanks for this hint. i ll do so.

    i changed the capital version to the following:

    <script type="text/javascript">

    now it validates fine.

    bye, chris

  6. twoalone
    Posted 10 years ago #

    script language stuff?

  7. vkaryl
    Posted 10 years ago #

    The "script language" usage is no longer valid; it now must read as toughIQ posted above.

Topic Closed

This topic has been closed to new replies.

About this Topic