Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Feb 2011
    Location
    England
    Posts
    103
    Member #
    26718
    Liked
    3 times
    Hi, got what is probably an easy one for somebody. I have embedded Simple Controls Gallery jquery into my web page. As part of it's functionality the images can all be hyperlinked. I'm trying to exploit this function to call a javascript routine that will open a new window, insert the current image, print it and then close the window.
    This is the function:
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    function BigPhoto(source){
      var source
      var newWindow = window.open("", "",
            "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, width=900, height=600, scrollbars=no");
          newWindow.document.write("<BODY BGCOLOR=#000000 LINK=#FFFFFF>");
        newWindow.document.write("<center>");
        newWindow.document.write("<a = 'javascript:window.refresh()'></a>")
        newWindow.document.write("<img src='" + source + "'/><br>");
        newWindow.document.write("</body></html>");
        newWindow.document.print();
        newWindow.document.close();
    }
    
    </SCRIPT>
    Here is the part of the image gallery
    Code:
    <script type="text/javascript">
    var mygallery=new simpleGallery({
        wrapperid: "simplegallery1", //ID of main gallery container,
        dimensions: [900, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
        imagearray: [
            ["Samurai/001.jpg", "", "", ""],
            ["Samurai/002.jpg", "", "", ""],
            ["Samurai/003.jpg", "", "", ""],
            ["Samurai/004.jpg", "", "", ""],
            ["Samurai/005.jpg", "", "", ""],
            ["Samurai/008.jpg", "", "", ""],
            ["Samurai/009.jpg", "", "", ""]
        ],
    The second "" is where you put the link. I just don't know how to code it to call the function BigPhoto and pass the parameter Source to it. For the first line "Source" would be Samurai/001.jpg.

    Any help please?

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Code:
      var source
    Take that line out of your BigPhoto function. You're already passing it as a parameter. This will result in a redefined variable.

    Not sure how to get the simpleGallery pictures hyperlinked. Never used it before.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member
    Join Date
    Feb 2011
    Location
    England
    Posts
    103
    Member #
    26718
    Liked
    3 times
    I'm lost too! Going to try a different approach.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:27 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com