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 rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    I'm a novise with regard to JavaScript.

    I've designed a homepage primarily built on PHP and MySQL (which I'm more confident with) but with some JavaScript here and there.

    I've laided out a set of pictures which when clicked on, launches a new larger version of the picture contained in a new window centered on stage. I'm able to put a small commentary in the status bar of the new window, but I'd like to do more.

    How can I alter the Title bar of the new window so it shows the name of the picture instead of listing the path to the folder where the picture came from?

    I know how to make a scrolling statusbar (which I don't use(abuse)) but it would be nice to have that function included in the new popup window as I then could include a longer textstring to describe the content and context of the picture.

    This is the simple function I made so far:
    Code:
     function openBig(bilde,h°yde,bredde,status)
      {
    
       var nytt_vindu=window.open('../images/familiebilder/images/'+bilde, 'nytt_vindu', 'height='+h°yde+',width='+bredde+',status,resizable');
       var skjerm_h°yde=window.screen.availHeight;
       var skjerm_bredde=window.screen.availWidth;
       var venstre_punkt=parseInt(skjerm_bredde / 2) -200;
       var topp_punkt=100;
       nytt_vindu.moveTo(venstre_punkt, topp_punkt);
       nytt_vindu.status=status;
      }
    </script>
    Then in HTML:
    Code:
    <td><a href="#" onclick="openBig('parameter','etc', 'etc'); return false;"><img src="The path" width="75" height="56" border='0'></a></td>
    (Never mind the strange variable names, they're in Norwegian)

    S. Rosland

  2.  

  3. #2
    Junior Member
    Join Date
    Aug 2003
    Location
    Birmingham UK
    Posts
    25
    Member #
    2854
    i'm assuming that the file being opened in the new window is the actual image and not a HTML file containing the image?

    If this is the case, then you will not be able to set the title of the window. One way around it is to open a HTML file that contains the image, and dynamically set the title in the this page. You could add things like captions then too!

  4. #3
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Hi RichPearce!

    Yes, the file beeing called is a pure image file.

    In PHP you can "echo" ("writeln" in JavaScript) HTML tags and content. I tried that approach after posting the question. Since I'm not referring to an URL in the functions window.open command, I figured the window didn't neccesarily generate HTML output and hence could be manipulated with some of my own suggestions.

    It worked! I can include HTML tags in the function definition, among other things Title info and a form tag for adding a close-button.
    It requires a lot of typing though, as you manually have to add all the HTML-fluff. I didn't have time to try the embedment of the scrolling-statusbar function inside the new-window function, as I had a plane to catch. But hopefully that works to.

    However, if anybody knows an easier workaround, let me know.
    S. Rosland


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 09:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com