mardi 18 septembre 2018

How to change opacity of a button after string ends with a digit

I am trying to change the opacity of a button (.'done') after a string is filled with a digit in the last place of my array("dashes").

I am using https://greensock.com/timelinemax to enable opacity

function subOpacity (){ 
var str = document.getElementById("dashes").innerHTML; 

if (str.endsWith(/\d/) == 4 )  {

// If I were using jquery but im not $('.done').fadeIn(900,1);
tlSubmitOpac = new TimelineMax();
tlSubmitOpac.set('.done',{opacity:0.5});
tlSubmitOpac.to('.done',1, {opacity:1,ease: Power2.easeOut}); //opacity full
}    
};

//.done button as follows:

    .done {
    opacity:0.5;
    background-color: white;
    border-radius: 25px;
    /* color: #9480b2; */
    color: #9480b2;
    width: 300px !important;
    /*margin-left: 220px; */
    height: 66px !important;
    border-radius: 15px;
    border: none;
   /* margin-top: 250px; */
    font-family: 'Knockout-30';
    font-size: 42px !important;
    letter-spacing: 0px !important;
    font-family: 'Knockout';
    position: fixed;
    top: 814px;
    left: 804px;
    }

Aucun commentaire:

Enregistrer un commentaire