Javascript Won't Work for "All Pages"
2 posters
Page 1 of 1
Javascript Won't Work for "All Pages"
I'm using a Javascript code to let me style tooltips on my forum. It works fine if I select any, or all, of the individual placement options but if I try to select "In all the pages", it suddenly stops working on any page.
The code is below:
Link to Site
Thank you for your help!
The code is below:
- Code:
(function () {
var ID = "tooltip", CLS_ON = "tooltip_ON", FOLLOW = true,
DATA = "_tooltip", OFFSET_X = 20, OFFSET_Y = 10,
showAt = function (e) {
var ntop = e.pageY + OFFSET_Y, nleft = e.pageX + OFFSET_X;
$("#" + ID).html($(e.target).data(DATA)).css({
position: "absolute", top: ntop, left: nleft
}).show();
};
$(document).on("mouseenter", "*[title]", function (e) {
$(this).data(DATA, $(this).attr("title"));
$(this).removeAttr("title").addClass(CLS_ON);
$("<div id='" + ID + "' />").appendTo("body");
showAt(e);
});
$(document).on("mouseleave", "." + CLS_ON, function (e) {
$(this).attr("title", $(this).data(DATA)).removeClass(CLS_ON);
$("#" + ID).remove();
});
if (FOLLOW) { $(document).on("mousemove", "." + CLS_ON, showAt); }
}());
Link to Site
Thank you for your help!
Last edited by Pendo on May 26th 2018, 9:18 am; edited 1 time in total
Re: Javascript Won't Work for "All Pages"
Where did you get this JavaScript from?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Won't Work for "All Pages"
SLGray wrote:Where did you get this JavaScript from?
Stackoverflow - Link to Question
It was put up by a ChrisF.
Re: Javascript Won't Work for "All Pages"
Maybe this will help: http://fmdesign.forumotion.com/t402-change-the-style-of-tooltips-with-tooltipster ?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Won't Work for "All Pages"
SLGray wrote:Maybe this will help: http://fmdesign.forumotion.com/t402-change-the-style-of-tooltips-with-tooltipster ?
I tried it (and actually think I prefer it) but I'm having the same problem as the other code. It works when I individually select pages for it to work on, but it doesn't work at all when I select all pages.
Re: Javascript Won't Work for "All Pages"
Post a link to a place that contains something that has a tooltip so we an see the code in action.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Won't Work for "All Pages"
SLGray wrote:Post a link to a place that contains something that has a tooltip so we an see the code in action.
Well, I enabled it in all of the individual sections just now so you can see it if you hover over any of the navigation menu options on the Homepage. The problem is, if I do it this way then the code doesn't work on pages that aren't expressly listed, creating inconsistencies.
Re: Javascript Won't Work for "All Pages"
Place it in all pages.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Won't Work for "All Pages"
You do only have the in all pages box checked, correct?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Won't Work for "All Pages"
SLGray wrote:You do only have the in all pages box checked, correct?
Yes, but I actually just fixed it.
I found a piece of the code for my widget tabs were returning an error that also included the tooltips code, for whatever reason. I removed that part of the other code and now the tooltip code is working for all pages.
Thank you! #Solved
Re: Javascript Won't Work for "All Pages"
Thanks for posting the solution.
Problem solved & topic archived.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» How to apply javascript to specific forumotion pages?
» Colorize cell wont work
» Javascript Pages Question
» Javascript in all pages problem
» Allowing only users to access pages [javascript]
» Colorize cell wont work
» Javascript Pages Question
» Javascript in all pages problem
» Allowing only users to access pages [javascript]
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum