Skip to main content
October 11, 2019
Question

Cambiar posición de un objeto con javascript

  • October 11, 2019
  • 2 replies
  • 3133 views

Hola:

 

Estoy intentando cambiar la posición y tamaño de un Smart Shape a través de Javascript. Consigo hacerlo a través de un botón pero necesitaría conseguirlo en el evento "Al Entrar" de la diapositiva y no funciona.

El código que utilizo es:

 

var obj = document.getElementById( "SmartShape_105c" );
obj.style.width = (420 ) + "px";

    This topic has been closed for replies.

    2 replies

    chrismay_at_delta17095116
    Inspiring
    October 11, 2019

    Anyway I find that Captivate is still manipulating smartshapes when it hits the OnEnter action. You need to create an interval and constantly loop through it until Captivate is finished and then your code will execute and "stick".

     

     

     

    var myInterval = setInterval(checkSize,100);
    function checkSize(){
       if(SmartShape_105c.style.width=="420px"){
         clearInterval(myInterval);
       }else{
         SmartShape_105c.style.width="420px";
       }
    }

     

     

    chrismay_at_delta17095116
    Inspiring
    October 11, 2019

    obj.style.width = "420px";

    chrismay_at_delta17095116
    Inspiring
    October 11, 2019

    oops I hit reply by accident when trying to add my reply... cannot hit the return key without submitting...