Skip to main content
Inspiring
December 18, 2016
Question

Javascript to re-position buttons

  • December 18, 2016
  • 1 reply
  • 485 views

This code below works for the button image, but the button is no longer clickable after re-positioning.

var obj = document.getElementById( 'myButtonc' );

var posX = parseInt( obj.style.left );

var posY = parseInt( obj.style.top );

obj.style.left = ( posX + 200 ) + 'px';

obj.style.top = ( posY + 200 ) + 'px';

Could someone please explain the code to move a clickable button?

I realize adding multi-states would work well, especially because I'm re-positioning all the buttons to the same x-y positions.  I would absolutely use multi-states for this if I could edit and apply a state to every button at once.

    This topic has been closed for replies.

    1 reply

    Inspiring
    February 10, 2017

    I have the same problem. It seems like only the standard state of the button is in the new position. The rollover- and down-states remain at the old position. Maybe somebody knows a solution, that would be really helpful.