Designed to make other elements clickable/tapable/pressable using its sibling or child links!
npm install jquery.clickablegit clone https://github.com/lawlesscreation/jquery.clickable.git
bower install jquery.clickable
html
`
$3
Option
Default
Description
callbackAfter
function() {}
A callback that is triggered after the element has been made clickable
clickableChild
null
Used to make a child element clickable of which the script was executed
clickableClass
clickable
The class that gets added to elements which have been successfully initialized
focusClass
clickable-focus
The class that gets added to the onFocus state of clickable elements
hoverClass
clickable-hover
The class that gets added to the onHover state of clickable elements
selectLink
null
Used to specify which link to use within the clickable box should more than one link be found
urlPrefixes
['http://', 'https://', 'www.']
An array of different prefixes that can appear before each link
Examples
$3
`javascript
$(function(){
$('#clickable-box').find('.box').jqueryClickable();
});
`
$3
`javascript
$(function(){
$('#clickable-image').find('.box').jqueryClickable({
clickableChild : 'img'
});
});
`
$3
`javascript
$(function(){
$('#clickable-image-from-heading').find('.box').jqueryClickable({
clickableChild : 'img',
selectLink : 'h4'
});
});
`
Development
You will need node.js before you get started, then:
`bash
$ npm install
#=> will install all required node packages
`
Then simply run either the watcher or build task:
`bash
$ grunt
#=> Running "watch" task
#=> Waiting...
`
or
`bash
$ grunt build
#=> Done, without errors.
``