github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

allmarkedup / jQuery-Hotspot

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master ✓
  • Switch Tags (0)
  • Branch List
Sending Request…

Gives grid-based custom hover and click events on DOM elements. — Read more

  Cancel

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Initial commit of project files 
Mark Perkins (author)
Sun Aug 22 05:30:55 -0700 2010
commit  2aed1cee9f1206b5843e
tree    37f6d5bfd8bdd05b23db
jQuery-Hotspot /
name age
history
message
file README.md Sun Aug 22 05:30:55 -0700 2010 Initial commit of project files [Mark Perkins]
file demo.html Sun Aug 22 05:30:55 -0700 2010 Initial commit of project files [Mark Perkins]
file jquery.hotspot.js Sun Aug 22 05:30:55 -0700 2010 Initial commit of project files [Mark Perkins]
README.md

jQuery Hotspot plugin

Programatically splits a DOM element into a user-defined grid and triggers custom events when grid squares are moused over or clicked on.

License

http://unlicense.org/ - i.e. do what you want with it :-)

Usage

Call the plugin on any DOM element, passing in a JSON object to define the number of rows and columns to build the (invisible) grid from:

var item = $('#item');
item.hotspot({ rows:3, cols:3 }); // split the target into a 3 by 3 grid

Then anytime the user's mouse enters a grid square it will trigger a custom event on the element, which also passes through the target row and column numbers.

item.bind('changed.hotspot', function( e, row, col ){
    console.log('currently hovering over: row: '+row+' col: '+col );
});

And anytime a click event happens on the element a similar custom event is triggered:

item.bind('clicked.hotspot', function( e, row, col ){
    console.log('CLICKED: row: '+row+' col: '+col );
});

That's it! See demo.html for a working example

Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文