Put an block anywhere in Croogo
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
README.mdown
distance.js
jquery.js

README.mdown

Distance Js

Description

You can put blocks into the following:

  • Layout
  • Views
  • Elements
  • Blocks (with a change, see below)
  • Blocks within blocks
  • Node body and excerpt
  • Any node field (if defined in BlockHelper::nodeFields)

Usage

Require

* >= jQuery 1.4

How to use

	<script type="text/javascript" src="distance.js"></script>

<script type="text/javascript">
	Distance.init();
</script>

specify 3 attributes to the parent elements ([data-with-distance] optional, data-lat, data-lng) and inside the parent attribute put the element class=distance

<li data-with-distance="true" data-lat="52.4800" data-lng="-1.9100">
		Distance from your location to Birmingham about : 	<span class="distance"></span>
	</li>