Sha256: b1afec7b471cb520c5d67cf0d60093c00988731c3d6558336afb61b1e26b3e2e

Contents?: true

Size: 1.89 KB

Versions: 12

Compression:

Stored size: 1.89 KB

Contents

---
layout: default
title:  "Drop Button"
---

Drop Button
===========

<div class="dropbutton"></div>

Use this drop button when you want to have one main button but also maybe sometimes a few other actions that are useful to have but you don't think will get used often.


~~~javascript
$(function () {
    window.dropbutton = new classes.DropButtonView({ 
        models: [{
            label: "Main option",
            main: true,
            onclick: "http://google.com"
        },
        {
            label: "Secondary option",
            onclick: function () {
                alert("You clicked the secondary option")
            },
            className: "secondary"
        },
        {
            label: "Tertiary option",
            onclick: "/colors.html"
        },
        {
            label: "Quaternary?",
            onclick: "/tabs.html",
            className: "quaternary warning"
        }]
    })
    $('.dropbutton').html(dropbutton.render().el)
})
~~~

Custom CSS:

~~~css
.quaternary.warning {
    background-color: red;
}

.secondary a {
    color: green;
}
~~~

<style>
.quaternary.warning {
    background-color: red;
}

.secondary a {
    color: green;
}
</style>

<script type="text/javascript">
$(function () {
    window.dropbutton = new classes.DropButtonView({ 
        models: [{
            label: "Main option",
            main: true,
            onclick: "http://google.com"
        },
        {
            label: "Secondary option",
            onclick: function () {
                alert("You clicked the secondary option")
            },
            className: "secondary"
        },
        {
            label: "Tertiary option",
            onclick: "/colors.html"
        },
        {
            label: "Quaternary?",
            onclick: "/tabs.html",
            className: "quaternary warning"
        }]
    })
    $('.dropbutton').html(dropbutton.render().el)
})
</script>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
atlas_assets-0.8.13 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.12 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.11 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.10 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.9 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.8 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.7 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.6 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.5 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.4 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.3 docs/_posts/2014-07-15-drop-button.md
atlas_assets-0.8.2 docs/_posts/2014-07-15-drop-button.md