How to Create Common Button in Html Template With Simple Js

Hey, Are you looking for an easy way how to use the common button and it shows every page in one js code?  you try this

// Buy Now Btn
$('body').append("<a href='' target='_blank' class='buy-now-btn'><img src='assets/img/envato.png' alt='envato'/>Buy Now</a>");

 

.buy-now-btn {
    img {
        top: 50%;
        left: 20px;
        width: 15px;
        position: absolute;
        transform: translateY(-50%);
    }
    right: 20px;
    z-index: 99;
    top: 50%;
    position: fixed;
    transform: translateY(-50%);
    border-radius: 30px;
    display: inline-block;
    color: $color-white;
    background-color: #82b440;
    padding: 10px 20px 10px 42px;
    box-shadow: 0 1px 20px 1px #82b440;
    font-size: 13px;
    font-weight: 600;
    &:hover {
        color: $color-white;
        background-color: #94be5d;
    }
}

 

Thanks ! If you have any queries, please let me know in the comments section.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *