@boikom

@boikom

Forum Replies Created

Viewing 3 posts - 916 through 918 (of 918 total)
  • Author
    Posts
  • in reply to: How to change the text color #98851
    admin
    Keymaster

    Hi Aleksandar,
    If you want to change button’s background color and color, please, set the following CSS variables:

    --smart-background-color: #55719e;
    --smart-color: white;

    More information about button’s CSS styling can be found here:
    https://www.htmlelements.com/docs/button-css/
    Best Regards,
    Ivailo
    SmartElements Team
    http://www.htmlelements.com

    in reply to: set items internally #98850
    admin
    Keymaster

    Hi Aleksandar,
    Here is how to set the dataSource property as an attribute:
    <smart-list-box data-source='["Order 1", "Order 4"]'></smart-list-box>
    Note that when setting properties as attributes, they have to be in dash-case (not in CamelCase), i.e. data-source, not dataSource.
    Best Regards,
    Dimitar
    SmartElements Team
    http://www.htmlelements.com

    in reply to: Dynamic change content of Tooltip #98843
    admin
    Keymaster

    Hi pcng618,
    In order to change the content of the Tooltip dynamically you need to set the innerHTML property of the Tooltip instance. To change it when clicking on a button you have to bind to it’s click event and simply set the new content to the innerHTML property of the Tooltip. Here’s an example:

    
    <head>
     <script>
            window.onload = function () {
                var tooltip = document.querySelector('smart-tooltip');
                document.getElementById('myButton').addEventListener('click', function (event) {
                    document.getElementById('tooltip').innerHTML = 'The button is clicked !';
                })
            }
        </script>
    </head>
    <body>
        <smart-button id="myButton"></smart-button>
        <smart-tooltip id="tooltip" selector="myButton">Some Random Text</smart-tooltip>
    </body>
    

    Best Regards,
    Christopher
    SmartElements Team
    http://www.htmlelements.com

Viewing 3 posts - 916 through 918 (of 918 total)