We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

michael64

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Change button color after clicking #56131
    michael64
    Participant

    It depends how you build your buttons:
    I see two solutions:
    1. Use Javascript to add or remove additional styles to the buttons, or
    2. Build the buttons from a combination of input labels

    <input type=”radio” name=”specialButton” class=”specialButtonTriggerStyleClass” id=”specialButton1″>
    <label class=”specialButtonStyleClass” for=”specialButton1″>Button 1</label>
    <input type=”radio” name=”specialButton” class=”specialButtonTriggerStyleClass” id=”specialButton2″>
    <label class=”specialButtonStyleClass” for=”specialButton2″>Button 2</label>

    <style>
    .specialButtonTriggerStyleClass {
    display: none;
    }
    .specialButtonTriggerStyleClass:checked + .specialButtonStyleClass{
    border: 2px solid green;
    }
    .specialButtonStyleClass {
    border: 2px solid red;
    }
    </style>`

    `

    in reply to: Resize not as expected #55747
    michael64
    Participant

    I’m using only Javascript to build the app. No puzzle.
    Could now solve my issue by calling app.onResize() after 200ms using timeout.

                setTimeout(function(){
                    app.onResize();
                }, 200);

    For some reasons the app wasn’t able to get the correct width without using the timeout.

    The solution is a little bit ugly but ok for now. :wacko:

    But thanks for the hint. :good:

Viewing 2 posts - 1 through 2 (of 2 total)