This time I will share jQuery Plugin and tutorial about jQuery Plugin To Create Editable Hotspots On Any Elements, hope it will help you in programming stack.
Hotspot is a jQuery plugin used to generate hotspots (e.g. comments, image annotations, text notes) on any Html elements.
Features:
- Display mode: Display hotspots like a tooltip. Can be triggered with hover or click.
- Admin mode: Add/remove/edit your custom hotspots and save them in local storage. View DEMO.
- Allows to handle hotspots via Ajax calls.
- Callback events supported.
Basic Usage:
1. Include jQuery library together with jQuery hotspot’s stylesheet & script in the document.
1 |
< link rel = "stylesheet" href = "jquery.hotspot.css" > |
2 |
< script src = "//code.jquery.com/jquery-1.11.1.min.js" ></ script > |
3 |
< script src = "jquery.hotspot.js" ></ script > |
2. Wrap the image into a DIV element.
1 |
< div id = "image-hotspots" > |
2 |
< img src = "images/1.jpg" > |
3. Call the plugin on the DIV element and set custom data for the image hotspots.
1 |
$( "#image-hotspots" ).hotspot({ |
3 |
{ "x" :288, "y" :190, "Title" : "Title 1" , "Message" : "Image annotation 1" }, |
4 |
{ "x" :143, "y" :200, "Title" : "Title 2" , "Message" : "Image annotation 2" }, |
4. Default settings and callbacks.
13 |
LS_Variable: '__HotspotPlugin_LocalStorage' , |
16 |
hotspotClass: 'HotspotPlugin_Hotspot' , |
19 |
hiddenClass: 'HotspotPlugin_Hotspot_Hidden' , |
23 |
interactivity: 'hover' , |
26 |
save_Button_Class: 'HotspotPlugin_Save' , |
27 |
remove_Button_Class: 'HotspotPlugin_Remove' , |
28 |
send_Button_Class: 'HotspotPlugin_Send' , |
31 |
unsavedHotspotClass: 'HotspotPlugin_Hotspot_Unsaved' , |
34 |
hotspotOverlayClass: 'HotspotPlugin_Overlay' , |
38 |
ajaxOptions: { url: '' }, |
44 |
'default' : 'jQuery Hotspot' |
47 |
'property' : 'Message' , |
48 |
'default' : 'This jQuery Plugin lets you create hotspot to any HTML element. ' |
Changelog:
v2.0.3 (2019-05-11)
- Supports on browser resize events.
v2.0.3 (2018-10-09)
- Fix image load issue in Firefox and Safari
2018-10-07
- bug fix for responsive image.
2015-05-23
This awesome jQuery plugin is developed by aniruddhanath. For more Advanced Usages, please check the demo page or visit the official website.