• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cambiar posición de un objeto con javascript

New Here ,
Oct 11, 2019 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

2.8K

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
community guidelines
Participant ,
Oct 11, 2019 Oct 11, 2019

Copy link to clipboard

Copied

obj.style.width = "420px";

Votes

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
community guidelines
Participant ,
Oct 11, 2019 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...

 

 

 

 

Votes

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
community guidelines
Participant ,
Oct 11, 2019 Oct 11, 2019

Copy link to clipboard

Copied

LATEST

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

 

 

Votes

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
community guidelines
Resources
Help resources