Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract contentText from an attribute of the target #24

Open
tqwhite opened this issue Sep 4, 2017 · 2 comments
Open

Extract contentText from an attribute of the target #24

tqwhite opened this issue Sep 4, 2017 · 2 comments

Comments

@tqwhite
Copy link

tqwhite commented Sep 4, 2017

I construct the stuff in a template. I stash the tools tips like this:

When I found that html5tooltip() doesn't allow you to simple specify an attribute for the content, I assumed I would have to iterate over the list of elements, extract the text and make the call.

The function is so nice that I actually can't believe that this is the case. Any advice?

@ytiurin
Copy link
Owner

ytiurin commented Sep 4, 2017

I guess you lost some code in your comment

@tqwhite
Copy link
Author

tqwhite commented Sep 4, 2017

Code did get lost. Sorry.

I like to put the tooltip info in an attribute to the html object in question, e.g.,

< div class='someClassName' tooltip='something >

I would like to call it with:

html5tooltip({

targetSelector: '.someClassName',
contentAttribute:'contentAttribute',
//etc

});

And have the function do something like:

var foundElement=$('.someClassName')[0];
var contentText=$(found element).attr('tooltip');

and use that contentText for the tooltip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants