SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member Ivanhoe's Avatar
    Join Date
    May 2001
    Location
    Ghent
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pop-up window background

    Hello

    Is it possible to do this with JavaScript?

    A clickable image leads to a pop-up with a bigger version of that image in it. The link is to the bigger image , not to a HTML-page with that big image in it.

    Default backgroud color in Windows for a pop-up is white. The pictures in the pop-up are rather dark, so I would like to have a black background in them.

    Is it possible to define this black background in my JS-code?

    The code is:

    function popup(URL, breedte, hoogte){
    window.open(URL,"","width="+eval(breedte)+", height="+eval(hoogte)+", status=yes, scrollbars=yes")


    Thanks in advance
    "If I would have anything special to say, I would write it down below the row of asterisks."

    ****************************************

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im not sure ur going to be able to do that unless you use a html page to load the image

  3. #3
    SitePoint Member Ivanhoe's Avatar
    Join Date
    May 2001
    Location
    Ghent
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I know, but that implicates that I will have to create a page for each image that should pop-up...

    That's why I wondered if it could be done in JavaScript.
    "If I would have anything special to say, I would write it down below the row of asterisks."

    ****************************************

  4. #4
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the script I use:
    Code:
    function openWindow1(url_param) {
      
      var popupWin = null;
      popupWin = window.open(url_param, 'remote', 'width=500,height=375,resizable=no,toolbar=no,left=10,top=10,scrollbars=no')
      popupWin.opener.name="main";
      popupWin.focus();
    }
    The pop-up opens to the size specified (which is the size of the image - I actually have several set to varying sizes for what I need). The thumbnail images link to html pages containing the large images rather than the large images themselves so that I can remove the margins otherwise set by default. If you wish to set a certain colour as the bg of the pop-up, I think you will have to do it this way too.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i dont think ull be able to make one page that will load ne graphic. ull jus have to make a script that wil open the page containg the larger images which means ull have to make a page for each (jus noticed that saz posted a script jus as i started typing this).

    the only way u would be able to make one page do all the grpahics and change the backgrounds accordenly is to use a server-side language (i could do it in ASP if you want and ur sever supports it)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •