a little questions about text open/close by one button and animation

  • HI, I'm new one I create one text hotspot and image hotspot

    here is my code


    I want to click the open image, and extend the text left to right, then the open image will change to close image. and the close image also can hide the text. I searched many threads still doesn't get it. pls help me.


    now did it, but I use two button(two image hotspot) on the same position. and use it to control text spot. I think this is a dumb methed.
    still can't control by 1 button

    js code like this


    Code
    function GetText(name,open,close){    //let _lang = language.getAttribute('data');    pano.call("tween(hotspot["+ name +"].alpha, 1 ,0.5)");     pano.call("tween(hotspot["+ name +"].height,150,0)");     pano.call("tween(hotspot["+ name +"].width,700,0.4)");     pano.call("set(hotspot["+ name +"].enabled,true)");    pano.call("set(hotspot["+ open +"].visible,false)");    pano.call("set(hotspot["+ open +"].enabled,false)");    pano.call("tween(alpha, 0 ,1)");    pano.call("tween(hotspot["+ close +"].alpha, 1 ,1)");    pano.call("set(hotspot["+ close +"].visible,true)");    pano.call("set(hotspot["+ close +"].enabled,true)");}


    Code
    function CloseText(name,close,open){    pano.call("tween(hotspot["+ name +"].alpha, 0 ,0.3)");     pano.call("tween(hotspot["+ name +"].width,0.4)");     pano.call("tween(hotspot["+ name +"].height,0)");     pano.call("set(hotspot["+ name +"].enabled,true)");    pano.call("set(hotspot["+ close +"].visible,false)");    pano.call("set(hotspot["+ close +"].enabled,false)");    pano.call("tween(alpha, 0 ,1)");    pano.call("tween(hotspot["+ open +"].alpha, 1 ,1)");    pano.call("set(hotspot["+ open +"].visible,true)");    pano.call("set(hotspot["+ open +"].enabled,true)");
    }


    and the animation is so lag, I don't know why?

    Edited 2 times, last by Garman (November 18, 2021 at 10:54 AM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!