Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

how to access tip DOM element from within plugins.tip({})? #9

Closed
AndrewFreemantle opened this Issue · 2 comments

2 participants

Andrew Freemantle Victor Berchet
Andrew Freemantle

Please update the documentation to show how one can get at the DOM element that the tip is shown for.

For example:

<a class="target" href="#" data-id="77" >A pair of pliers</a>
<a class="target" href="#" data-id="81" >A blowtorch</a>

How would one get at the $(....).attr("data-id") when doing an Ajax call like so:

// Ajax content
$("a.target").tipSwift({
  plugins: [
  $.tipSwift.plugins.tip({
    filterContent: function(content, positionner) {
      content.html(' - some loading image - ');
      // If one does an ajax call here to get a string, how does one get at "data-id" ?
      content.load(myAjaxLoadedString, function() { positionner(); });
    }
  })
]

Many thanks

Victor Berchet
Owner

See the examples https://github.com/vicb/tipsy-swift/blob/master/demo/demo.html#L138, you can get the element from ts.element. If this solve your pb, I would appreciate if you can submit a PR for the doc.

Victor Berchet vicb closed this
Andrew Freemantle

Thanks, I'll try your suggestion and if I can get it working I'll update the docs :o)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.