Heh, I just started a different thread asking for this. :)
Trying to convert it out now.

Thanks!

( I am falling asleep at the wheel)

Glen

On 6/23/07, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:

 I want to maintain proportion, but scale it to fit in the view port.0

Got some PHP code laying around that does just that. Should be easy to
convert to JS:


------------------------------------------------------------------------------------------------------------------------------------------------
function fitObjectInBox($objectWidth, $objectHeight, $boxWidth,
$boxHeight)
{
    // Fit's our image in a box with a given width and heigth while
proportions remain,
    // *or* resizes it based on one site proportionally if only width or
height is given
    $widthRatio  = @($boxWidth / $objectWidth);
    $heightRatio = @($boxHeight / $objectHeight);

    if (($widthRatio < $heightRatio) && ($widthRatio!=0) ||
($heightRatio==0))
    {
        $ratio = $widthRatio;
    }
    else
    {
        $ratio = $heightRatio;
    }

    $new_width = ceil($objectWidth * $ratio);
    $new_height = ceil($objectHeight * $ratio);

    return array($new_width, $new_height);
}

------------------------------------------------------------------------------------------------------------------------------------------------

HTH, Felix
--------------------------
My latest blog posts:

 [image: ThinkingPHP and 
beyond]<http://feeds.feedburner.com/%7Er/thinkingphp/%7E6/1>

My Business: http://www.fg-webdesign.de


Glen Lipka wrote:

Sorry, working on it right now. :)
I fixed that.  Trying to figure out how to position it in the middle of
the screen and adjust the height width so it makes sense.
The logic is a little tortuous on my mind.

I want to maintain proportion, but scale it to fit in the view port.
Is there a resize plugin?

Glen

On 6/23/07, Aaron Heimlich <[EMAIL PROTECTED]> wrote:
>
> I got this error on FF 2.0.0.4 (Mac OS 10.4.10):
>
> e.css is not a function
> http://www.commadot.com/jquery/easebox/easeBox.js
> Line 59
>
> Stack trace:
>  showZoom(a matt-big.jpg)easeBox.js (line 59)
> (no name)()easeBox.js (line 27)
> (no name)( click clientX=0, clientY=0)jquery-latest.js (line 1398)
> handle (click clientX=0, clientY=0)jquery-latest.js (line 1302)
>  e.css("z-index","1001");
>
>
> On 6/24/07, Glen Lipka <[EMAIL PROTECTED] > wrote:
> >
> > dimScreen is great.
> > Check it out:
> > http://www.commadot.com/jquery/easebox/
> >
> > Although, I changed it slighly to use $(window).width() instead of
> > $(document).width()
> > This might only work with the dimensiosn plugin included.
> >
> > Glen
> >
> >  On 6/23/07, Glen Lipka < [EMAIL PROTECTED] > wrote:
> > >
> > > It should be Rey Bingo!
> > > That's exactly it.  Awesome.  Thanks. :)
> > >
> > > Glen
> > >
> > > On 6/23/07, Rey Bango < [EMAIL PROTECTED] > wrote:
> > > >
> > > >
> > > > dimScreen:
> > > >
> > > > http://docs.jquery.com/Plugins/dimScreen
> > > >
> > > > Glen Lipka wrote:
> > > > > I can't find it, but I vaguely remember someone had a plugin
> > > > that just
> > > > > puts a 50% opacity overlay over the page.
> > > > > Sort of like a thickbox thing, but without all the other stuff.
> > > > > Does anyone know where it is?
> > > > >
> > > > > Glen
> > > >
> > > > --
> > > > BrightLight Development, LLC.
> > > > 954-775-1111 (o)
> > > > 954-600-2726 (c)
> > > > [EMAIL PROTECTED]
> > > > http://www.iambright.com
> > > >
> > >
> > >
> >
>
>
>  --
> Aaron Heimlich
> Web Developer
> [EMAIL PROTECTED]
> http://aheimlich.freepgs.com




Reply via email to