how to do this visual effect ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Abou Jaoude

    #1

    how to do this visual effect ?



    I was asked to do the folowing visual effect, and I was wondering if
    someone knows how to.
    To view the visual effect , go to this link:
    http://v4.windowsupdate.microsoft.com/en/default.asp (windows update)
    In the left pan, click on pick updates to install
    then choose windows 2000(11).
    in the page displayed, click on the add or remove buttons,and the text
    goes to the left-right.
    I want to produce this in my application.
    any thoughts ?



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Lasse Reichstein Nielsen

    #2
    Re: how to do this visual effect ?

    Joe Abou Jaoude <joe30@hotmail. com> writes:
    [color=blue]
    > I was asked to do the folowing visual effect, and I was wondering if
    > someone knows how to.[/color]
    [color=blue]
    > To view the visual effect , go to this link:
    > http://v4.windowsupdate.microsoft.com/en/default.asp (windows update)[/color]

    It is worth mentioning that this page requires IE.
    [color=blue]
    > In the left pan, click on pick updates to install
    > then choose windows 2000(11).
    > in the page displayed, click on the add or remove buttons,and the text
    > goes to the left-right.
    > I want to produce this in my application.[/color]

    Why?
    [color=blue]
    > any thoughts ?[/color]

    Make a div matching the text to move, move it and shrink it at the same time.
    Try this:

    ---
    <!DOCTYPE html PUBLIC "...">
    <html>
    <head><title>Te st</title>
    <style type="text/css">
    #mover {
    position:absolu te;
    border:1px solid black;
    overflow:hidden ;
    visibility:hidd en;
    }
    </style>
    </head>
    <body>
    <div id="around">
    <div id="mover">Denn e tekst skal flyttes.<br>Om lidt.</div>
    Denne tekst skal flyttes.<br>Om lidt</div>
    <script type="text/javascript">
    function moveElemTo(elem ,x,y,sizex,size y,steps,freq) {
    var cur_x = elem.offsetLeft ;
    var cur_y = elem.offsetTop;
    var cur_sizex = elem.offsetWidt h;
    var cur_sizey = elem.offsetHeig ht;
    var ctr = 0;
    var es = elem.style;
    es.visibility=" visible";
    var stepFunc = function stepFunc() {
    ctr++;
    var per = ctr/steps;
    var nper = 1-per;
    es.left = Math.round(cur_ x * nper + x * per)+"px";
    es.top = Math.round(cur_ y * nper + y * per)+"px";
    es.width = Math.round(cur_ sizex * nper + sizex * per)+"px";
    es.height = Math.round(cur_ sizey * nper + sizey * per)+"px";
    if (ctr < steps) {setTimeout(ste pFunc,freq);}
    else {es.visibility= "hidden";}
    }
    stepFunc();
    }
    </script>
    <script type="text/javascript">
    var down = true;
    var around = document.getEle mentById("aroun d");
    var mover = document.getEle mentById("mover ")
    function clickHandler(ev ent) {
    event = event || window.event; // IE sucks
    if (down) {
    moveElemTo(move r,event.clientX ,event.clientY, 0,0,20,100)
    } else {
    moveElemTo(move r,around.offset Left,around.off setTop,around.o ffsetWidth,
    around.offsetHe ight,20,100);
    }
    down=!down;
    }
    var root = document.docume ntElement||docu ment.body;
    if (root.addEventL istener) {
    root.addEventLi stener("click", clickHandler,fa lse);
    } else {
    root.onclick=cl ickHandler;
    }
    </script>
    </body>
    </html>
    ---

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...