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

Exception occured ,not support on attribute #1

Closed
yeaicc opened this issue May 22, 2014 · 12 comments
Closed

Exception occured ,not support on attribute #1

yeaicc opened this issue May 22, 2014 · 12 comments

Comments

@yeaicc
Copy link

yeaicc commented May 22, 2014

sorry my english ,I am Chinese

Line Number:767
Source code:el.on(trigger + '.jBox-attach-' + this.id, function(ev)

I use it like this:$("a[title]").jBox("Tooltip");

@StephanWagner
Copy link
Owner

That's because the title attribute gets removed when the jBox initializes, otherwise you would have two tooltips, the jBox one and the browsers default tooltip.

Try to attach the tooltip to another attribute:

$("a[data-tooltip]").jBox("Tooltip");
<a href="/" data-tooltip title="My tooltip">My link</a>

@yeaicc
Copy link
Author

yeaicc commented May 22, 2014

I got the exception again.

@StephanWagner
Copy link
Owner

Hmm, thats odd.
Can you post some more code please. The JavaScript and the HTML, so i can reproduce the error.

@yeaicc
Copy link
Author

yeaicc commented May 22, 2014

image
image

@StephanWagner
Copy link
Owner

jQuery code needs to be executed only when Dom is ready, try this:

<script>
$(document).ready(function() {
    $('a[data-tooltip]').jBox('Tooltip');

    // More jQuery code here
});
</script>
<a href="/" data-tooltip title="My tooltip">My link</a>

@yeaicc
Copy link
Author

yeaicc commented May 22, 2014

Beginning,I do it like that. The exception occur also.

@StephanWagner
Copy link
Owner

I'm not sure what could be the problem, because above code is working on my machine. See the fiddle here:

http://jsfiddle.net/84yHt/

Maybe it's another library you are using which interferes with jBox.

@yeaicc
Copy link
Author

yeaicc commented May 22, 2014

This is my source code:
image

@StephanWagner
Copy link
Owner

This should work, heres the fiddle with that code, and it's working as expected:

http://jsfiddle.net/84yHt/1/

What jQuery version are you running? jBox needs at least 1.11 (It should work with older versions too but It's not tested on those)

@yeaicc
Copy link
Author

yeaicc commented May 22, 2014

The jQuery version is 1.4.4.
I save the code to a file that named test.htm,then I open it.
But It does not work on my machine.
My god,what happened.

@StephanWagner
Copy link
Owner

That seems to be the problem. Your jQuery version is too old. Try to update:

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>

@yeaicc
Copy link
Author

yeaicc commented May 22, 2014

Thanks,It working now.

@yeaicc yeaicc closed this as completed May 22, 2014
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