SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot GregShasta's Avatar
    Join Date
    Jul 2001
    Location
    atlanta ga
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    window parameter help

    hey guys,
    I've got this image gallery that i want to display in pop up windows. The code i have been using so far is:
    onClick="window.open('some.html','1','resizable=no,height=111,width=111,');"

    ok now it works fine but i have two problems. 1)how do i put scrollbars on only the images that need them when they need them? and 2)can i forgo the trouble of making an html page and just insert say some.gif instead of some.html and avoid the whitespaces created by the padding. In short i am aiming for the 'cleanest' window and I dont want any whitespace on the new window just the image.

    Now the reason for part two is that unfortunately im using a free host and they stick their hideous banner on any html page. So, it would be great if I could just use the image itself and modify it so that only the image showed.

    sorry for the length of the post,
    Greg Shasta
    'I guess that my ambition was to be a bum'--robert mitchum

  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New Window Parameters

    The simplest think you can do it use this script:

    Code:
    <script language="JavaScript">
    <!--
    // put this code in the header
    
    function openPopUpWindow(theURL,winName,features)
    window.open(theURL,winName,features);
    
    //-->
    </script>
    and then.... if you want user to click and pop-up to appear then use this sample as a guidence (its a link from image that pop's up new window):

    Code:
    <a href="JavaScript:openPopUpWindow('Full_Image1.jpg','ImageWindowName','locati-on=No,status=No,scrollbars=No,resizable=No,width=XXX,height=XXX')">
    <img src="thumbs/image1.JPG" width="XXX" height="XXX" border="0"></a>
    replace the following:
    'Full_Image1.jpg' = to the FULL image name and URL (make sure you use single quote' to )
    for example: 'Kajol.jpg'
    'ImageWindowName' = just a title of the image.... you can just leave it as 'LoadingPleaseWait'
    (no sapce or _ or - or any other like ~#!` or (.) oh... no fullStops either)


    here are some meaning of whats what
    features => Meaning
    location=No => don't show browser Address bar
    status=No => Dont show the Status bar (handy if you dont want peole to know where the image is coming from... or where its stored)
    scrollbars=No => Don't allow user to scroll at all (set it to Auto if you want it only to show when a large picure is shown)
    resizable=No => Don't allow user to resize the window
    width=XXX => Important!: set this same as the image width
    height=XXX => Again Set this same as the image Height

    [you may need to set the width and height a bit more than original because of the windows border and so on.. but test it and see if you need to.]

    now that's all for the script
    and now for the Image user click:

    src="thumbs/image1.JPG" => where the thumb' file is
    width="XXX" => this is same as last time the image width
    height="XXX" => Again image height
    border="0" => Do you what a border wround the pic? N0 =0 else border="anyNumberHere"

    I hope that was clear and simple enough!

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good explanation! i also remember seeing a script which would automatically open a window that was big enough (i.e size itself accordingly) at the www.javascriptsource.com -- shoot on over there and have a search around..
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


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
  •