Navigation Menu

Skip to content

mashalla/button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Accessible Button

Provides a class that makes an input button accessible or tranfers it to a accessible toggle button

Screenshot

How to use

#HTML
<input class='button' id="MooAccessButton" type="button" value="Push me" onclick="alert('You pushed the button successfully.')"/>

#JS
window.addEvent('domready', function() {
	var mooAccessButton = new AccessibleButton({
		'button' : $('MooAccessButton'), // input button element
		'ariaDescription' : 'MooAccessButtonDescription' // allows you to define a element that describes the button
	})
	var mooAccessToggleButton = new AccessibleButton({
		'button' : $('MooAccessToggleButton'),
		'ariaDescription' : 'MooAccessToggleButtonDescription',
		'toggle' : true,
		'clickFunction' : function(e) { // event function for pressing the button
			$('buttonLive').set('html','Button pressed.')
		},
		'releaseFunction' : function(e) { // event function for releasing the button
			$('buttonLive').set('html','Button released.')
		}
	})
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published