Coder Social home page Coder Social logo

buttonbuddy's Introduction

ButtonBuddy

Tiny js based helper for creating buttons

Quick Start

Step 1: Insert the ButtonBuddy.js into the head of your html document

<script src="ButtonBuddy.js"></script>

Step 2: Generate your first button. Just include a script part before the closing body tag and initalize your button.

<script>
        
        var myButton = new ButtonBuddy('My Testbutton');

        myButton.on('click', function() {

            alert('Hello there');

        })
        
</script>

Public methods

on

With the on method you can quickly add events to the button.

NOTE: If you use the type click ButtonBuddy automaticly adds a event.preventDefault()

<script>
        var myButton = new ButtonBuddy('My Testbutton');

        myButton.on('click', function() {

            alert('Hello there');

        })

        myButton.on('mouseover', function() {

            alert('Hello there');

        })
</script>

Static methods

useCssLoader

By default ButtonBuddy loads automaticlly the base css file in the head. If you don`t like this feature just disable it:

        ButtonBuddy.useCssLoader(false);

setGlobalCssPath

Define the path to the css file wich should be automaticcly loaded. Note that the path begins with the origin domain.

@dependency: useCssLoader = true

        ButtonBuddy.setGlobalCssPath('path/to/my/cssFile/style.css');

buttonbuddy's People

Contributors

may17 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.