A basic jQuery plugin for finding out who represents you in federal and state legislatures
A Basic jQuery plugin that renders a form into the specified target, geocoding input and displaying results from Sunlight's Congress and Open States APIs.
dist/jquery.findyourrep-pack.min.js
on your page (in that order).findYourRep()
on an element: $('.myDiv').findYourRep({
apikey: 'your-key'
});
Passed as a javascript object to the constructor, just like any jQ plugin.
apikey
: Your Sunlight Labs API key (required)apis
: A comma-delimited list of apis to query.apis: 'congress'
apis: 'congress, openstates'
'congress, openstates'
.title
: The title of the widget. Default is 'Find Your Representatives'text
: The text that displays above the textarea for the user's address.action
: The text of the button that finds your reps. Default is 'Go!'There's an included stylesheet which you can add to your page to add some basic style.
By default, all CSS is scoped to a container classname, .fyr-container
. There's a scss source file
available in the src/css
folder which you can edit to add your own style.
Screenshots:
npm install && bower install && grunt demo
BSD3