Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #68 from humancopy/master
Browse files Browse the repository at this point in the history
Add an example on how to trigger the change event
  • Loading branch information
paulstraw committed Dec 27, 2014
2 parents ad69447 + e9012c8 commit 364b9b7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions readme.md
Expand Up @@ -99,4 +99,27 @@ $('.bulbs').fancySelect({
}
}
})
```

Triggering the change event
---------------------------

You can listen to the `change.fs` event in order to trigger the DOM's change event on the `<select>` element.

### HTML

``` html
<select class="my-select" disabled>
<option>First Option</option>
<option>Second Option</option>
</select>
```

### JavaScript

``` javascript
var mySelect = $('.my-select');
mySelect.fancySelect().on('change.fs', function() {
$(this).trigger('change.$');
}); // trigger the DOM's change event when changing FancySelect
```

0 comments on commit 364b9b7

Please sign in to comment.