whereyat
v0.1.2
Published
[Homepage](http://www.wherey.at/)
Downloads
1
Maintainers
Readme
Where Y'at
Where Y'at uses IP geo-location to measure the distance between a point you specify and the user visiting your site. It will add classes to your DOM based on the measured distance. This means you can selectively display different content to your users based on how far away they are.
Getting Started
Download the production version or the development version.
In your web page:
<script src="jquery.js"></script>
<script src="dist/jquery.whereyat.min.js"></script>
<script>
jQuery(function($) {
$.whereyat();
});
</script>
cdnjs
cdnjs is a free cdn from CloudFlare. It's a really great project, and we are grateful to be a part of it.
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/whereyat/0.1.2/jquery.whereyat.min.js"></script>
Documentation
Defaults and callbacks.
$.whereyat({
className: '.whereyat',
classPrefix: 'yat-',
latitudeData: 'yatLat',
longitudeData: 'yatLong',
maxDistance: 'xl',
units: 'miles', // or 'kilometers'
distances: { // distances in units
'xs': 75,
'sm': 200,
'md': 750,
'lg': 1250
}
}, function() {
// user is located when this executes
});
Release History
v0.1.2 - Added support for Units option v0.1.1 - First Release
Contributing
Send us pull requests here, please.