« Return to Thread: Widget Challenge

Re: Widget Challenge

by Dan Atkinson :: Rate this Message:

Reply to Author | View in Thread

As an aside,

I wrote out this in a webpage with a few choice icons.

It doensn't really work in IE, but I thought I'd stick your code up there:

http://dan-atkinson.com/fisheye/

Cheers,

Dan
Paul Bakaus wrote:
Hi!

I have put up a little function that does something like the fisheye plugin.
However, this is only a concept, it doesn't behave like the real one. It
will not detect near containers and therefore is not very smooth.

the function:

$.fn.fisheye = function() {
    this.each(function() {
        var fishHeight = parseInt($("img", this).height());
        var fishWidth = parseInt($("img", this).width());

        $(this.childNodes).hover(
        function() {
            $(this.childNodes).animate({ height: 150, width: 150 }, 200);

        },
        function() {
            $(this.childNodes).animate({ height: fishHeight, width:
fishWidth }, 500);
        });
    });
}

test it like this:
    <ul class="fisheye">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>

and style the ul like you want it. have fun.
--
Paul Bakaus
Web Developer
------------------------
Hildastr. 35
79102 Freiburg

 « Return to Thread: Widget Challenge