Highlighted

Cambiar posición de un objeto con javascript

New Here ,
Oct 11, 2019

Copy link to clipboard

Copied

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";

Views

170

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Cambiar posición de un objeto con javascript

New Here ,
Oct 11, 2019

Copy link to clipboard

Copied

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";

Views

171

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Participant ,
Oct 11, 2019

Copy link to clipboard

Copied

obj.style.width = "420px";

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Participant ,
Oct 11, 2019

Copy link to clipboard

Copied

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

 

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Participant ,
Oct 11, 2019

Copy link to clipboard

Copied

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";
   }
}

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Resources
Captivate User Guide
New Group