JavaScript Ribbon

Set the initContent property of the jqxRibbon. Author: http://jqwidgets.com

by jqwidgets

HTML

<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<div id="jqxRibbon">
    <ul>
        <li>Item 1</li>
        <li>Item 2</li>
        <li>Item 3</li>
    </ul>
    <div>
        <div>A jqxButton:
            <br />
            <button id="jqxButton">Button</button>
        </div>
        <div>A jqxDropDownList:
            <br />
            <div id="jqxDropDownList"></div>
        </div>
        <div>Content 3</div>
    </div>
</div>

JavaScript

$("#jqxRibbon").jqxRibbon({
    theme: "energyblue",
    width: 300,
    height: 200,
    position: "top",
    selectionMode: "click",
    initContent: function (index) {
        switch (index) {
            case 0:
                $("#jqxButton").jqxButton({
                    theme: "energyblue"
                });
                break;
            case 1:
                var source = [
                    "Affogato",
                    "Americano",
                    "Bicerin",
                    "Breve",
                    "Café Bombón",
                    "Café au lait",
                    "Caffé Corretto",
                    "Café Crema",
                    "Caffé Latte"];

                $("#jqxDropDownList").jqxDropDownList({
                    theme: "energyblue",
                    source: source,
                    selectedIndex: 0,
                    width: 200,
                    height: 25
                });
                break;
        }
    }
});