Skip to content

Commit

Permalink
Docs updated after last merge, the new option has been renamed and it…
Browse files Browse the repository at this point in the history
…s default value changed
  • Loading branch information
lorenzos committed Oct 26, 2013
1 parent 024b72e commit 6cdd451
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@ A MooTools plugin that displays image tooltips when you rollover links and thumb
How to use
----------

JS sample:
HTML markup:

#HTML

<div>
Standard tip:
<a href="#" class="imagetip" data-image="image.jpg" title="Label">link</a>.
</div>

<div>
Customized tip:
<a href="#" class="mylinks" data-image="image.jpg" title="Label">link</a>.
</div>

JS code:

#JS

Expand All @@ -21,28 +35,14 @@ JS sample:
// If you want to customize the tip, you can use some options
window.addEvent('domready', function() {
var myAdvancedImageTip = new MooImageTip({
offset: {x: 4, y: 4}, // Offset relative to mouse position
className: 'mylinks', // This is the links class name
tipId: 'mytip', // This is the tip ID, for styling
follow: false, // Tip will not follow the mouse cursor
fx: { duration: 'short' } // Additional Fx options
offset: { x: 4, y: 4 }, // Offset relative to mouse position
className: 'mylinks', // This is the links class name
tipId: 'mytip', // This is the tip ID, for styling
follow: false, // Tip will not follow the mouse cursor
fx: { duration: 'short' } // Additional Fx options
});
});

HTML code:

#HTML

<div>
Standard tip:
<a href="#" class="imagetip" rel="image.jpg" title="Label">link</a>.
</div>

<div>
Customized tip:
<a href="#" class="mylinks" rel="image.jpg" title="Label">link</a>.
</div>

CSS rules:

#CSS
Expand Down Expand Up @@ -77,6 +77,7 @@ Docs
- **`tipId`**: ID for the tip element, for styling (default `"mooimagetip"`).
- **`follow`**: If `TRUE` (default) tip will follow mouse cursor movements.
- **`fx`**: An object for additional `Fx` options (tip fade in/out).
- **`source`**: Attribute name in which you place the image URL (default `"data-image"`).

**Events:**

Expand Down
4 changes: 2 additions & 2 deletions Source/mooimagetip.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var MooImageTip = new Class({
tipId: 'mooimagetip',
follow: true,
fx: { },
dataSource: 'data-photo'
source: 'data-image'
},

initialize: function(options) {
Expand All @@ -36,7 +36,7 @@ var MooImageTip = new Class({
'mouseenter': function(e) {
var title = $(item).getProperty('title');

var image = $(item).getProperty($this.options.dataSource);
var image = $(item).getProperty($this.options.source);
if (!image) return;

if (!title) title = $(item).getProperty('data-title_original');
Expand Down

0 comments on commit 6cdd451

Please sign in to comment.