/    Sign up×
Community /Pin to ProfileBookmark

Image Popup (auto sized) + scroll bars, images larger than screen

Hey, I know there have been a gazillion questions on popups already, and I spent the last hour searching but I couldn’t find anything that really helped me ?

I had a wonderful popup script that worked pretty nice in Mozilla, but when I tried it in IE it was a catastrophe.

After searching a bit here I found the following code and tried it with that. It works ok, but there are a few issues:

  • My images are larger than the screen sometimes, so I need the popup to have scroll bars. [I]and yes, I found a thread about adding scrollbars to popups, but I couldn’t get any help from it.[/I]

  • there’s a white frame around each image, how can I get rid of that?

  • [CODE]<!– Begin
    function picWindow(piclink)
    {
    pic = new Image();
    pic.src = (piclink);
    picWindow_getSize(piclink,1);
    }

    function picWindow_getSize(piclink,attempt)
    {
    if (attempt == 20)
    {
    picWindow_Open(piclink,580,580);
    }
    else if (pic.width != 0)
    {
    picWindow_Open(piclink,pic.width,pic.height);
    }
    else
    {
    attempt += 1;
    timeoutfunction = ‘picWindow_GetSize(“‘ + piclink + ‘”,’ + attempt + ‘)’
    setTimeout(timeoutfunction,50);
    }
    }

    function picWindow_Open(piclink,width,height,features)
    {
    width = width + 20;
    height = height + 20;
    win = window.open(piclink,”,’width=’ + width + ‘,height=’ + height + ‘,left=275’ + ‘,top=50’);
    }
    // End –>[/CODE]

    I am a complete newbie to Javascript, sorry if this is kind of a simple thing.

    Also, if someone has a complete different solution that works in as many browsers as possible, is auto-resizing, has scrollbars and no white frame, please please please post it. ?

    Thanks!

    to post a comment
    JavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @Mr_JNov 20.2005 — You need to add

    scrollbars = yes



    [code=php]win = window.open(piclink,'','width=' + width + ',height=' + height + ',left=275' + ',top=50, scrollbars=yes');[/code]
    ×

    Success!

    Help @Weatherwitch spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...