clipping questions

Discussion in 'Javascript' started by Pugi!, Mar 15, 2006.

  1. Pugi!

    Pugi! Guest

    I am currently experimenting a bit with clipping (with banners).
    1. Is it possible to do more then one clipping on a image. For example:
    image of 400px x 80 px:
    var TELLER = 0;
    function unfoldPic() {
    TELLER++;
    if (TELLER <= 80) {
    CURR_PIC.style.clip = 'rect(0px 400px ' + TELLER + 'px 0px)';
    window.setTimeout('unfoldPic()', 30);
    }
    }
    This reveals the new pic gently from top to bottom.
    But I would like to do something like this.
    var TELLER = 0;
    function unfoldPic() {
    TELLER++;
    if (TELLER <= 10) {
    CURR_PIC.style.clip = 'rect(0px 400px ' + TELLER + 'px 0px)';
    CURR_PIC.style.clip = 'rect(10px 400px ' + (TELLER+10) + 'px 0px)';
    CURR_PIC.style.clip = 'rect(20px 400px ' + (TELLER+20) + 'px 0px)';
    CURR_PIC.style.clip = 'rect(30px 400px ' + (TELLER+30) + 'px 0px)';
    CURR_PIC.style.clip = 'rect(40px 400px ' + (TELLER+40) + 'px 0px)';
    CURR_PIC.style.clip = 'rect(50px 400px ' + (TELLER+50) + 'px 0px)';
    CURR_PIC.style.clip = 'rect(60px 400px ' + (TELLER+60) + 'px 0px)';
    CURR_PIC.style.clip = 'rect(70px 400px ' + (TELLER+70) + 'px 0px)';
    window.setTimeout('unfoldPic()', 100);
    }
    }
    To give the impression that there 8 blinds/layers opening/revealing the new
    pic.
    I am afraid that to accomplish this I will have to divide each image in 8
    layers to be able to do this and address each and everyone of these layers
    seperately.

    2. Can one do clipping with something else then rect ? Ellipse, circle, ....

    thanx,

    Pugi!
     
    Pugi!, Mar 15, 2006
    #1
    1. Advertising

  2. Pugi!

    VK Guest

    Pugi! wrote:
    > I am currently experimenting a bit with clipping (with banners).
    > 1. Is it possible to do more then one clipping on a image.
    > To give the impression that there 8 blinds/layers opening/revealing the new
    > pic.
    > I am afraid that to accomplish this I will have to divide each image in 8
    > layers to be able to do this and address each and everyone of these layers
    > seperately.


    Not necessary. You can have a matrix of non-transparent div's atop of
    your image and shrink them in a loop. Microsoft transition does the
    desired effect in one line of code, but unfortunately not supported by
    anyone else.

    > 2. Can one do clipping with something else then rect ? Ellipse, circle, ....


    The same approach but use clipping images (of circles etc) atop of the
    image you want to reveal.
     
    VK, Mar 15, 2006
    #2
    1. Advertising

  3. Pugi!

    Pugi! Guest

    "VK" <> schreef in bericht
    news:...
    >
    > Pugi! wrote:
    >> I am currently experimenting a bit with clipping (with banners).
    >> 1. Is it possible to do more then one clipping on a image.
    >> To give the impression that there 8 blinds/layers opening/revealing the
    >> new
    >> pic.
    >> I am afraid that to accomplish this I will have to divide each image in 8
    >> layers to be able to do this and address each and everyone of these
    >> layers
    >> seperately.

    >
    > Not necessary. You can have a matrix of non-transparent div's atop of
    > your image and shrink them in a loop. Microsoft transition does the
    > desired effect in one line of code, but unfortunately not supported by
    > anyone else.
    >
    >> 2. Can one do clipping with something else then rect ? Ellipse, circle,
    >> ....

    >
    > The same approach but use clipping images (of circles etc) atop of the
    > image you want to reveal.
    >


    Hmmmm, you gave me some ideas. Still have some questions, but will start new
    thread.

    Pugi!
     
    Pugi!, Mar 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dixon
    Replies:
    4
    Views:
    574
    Piotr Dobrowolski
    Jan 30, 2006
  2. Steve
    Replies:
    3
    Views:
    4,206
    Steve
    Jan 22, 2004
  3. john
    Replies:
    1
    Views:
    623
    alan.washington
    Oct 20, 2004
  4. humbads
    Replies:
    4
    Views:
    1,290
    Shailesh Humbad
    Feb 16, 2006
  5. windandwaves
    Replies:
    1
    Views:
    388
    windandwaves
    Apr 10, 2006
Loading...

Share This Page