Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6885975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:42:06+00:00 2026-05-27T05:42:06+00:00

I am very newby as doing this jquery plugins and I started working on

  • 0

I am very newby as doing this jquery plugins and I started working on this tooltip plugin:

jQuery(function ($) {
    $.fn.simpleMessageTtip = function (options) {
        var settings = {
            'messageTxt': 'The notification frequency has been updated',
        };

        if (options) {
            $.extend(settings, options);
        }

        var getTooltip = function () {
            var tTip =
                '<div class="simple-message-tooltip">' +
                    '<div class="message clearfix">' +
                        '</div>' +
                            '<div class="bubble-pointer-bottom"></div>' +
                                '</div>';
            return tTip;
        };

        $("body").prepend(getTooltip());

        $(this).each(function () {
            var $this = $(this); //the caller of the ttip
            var tip = $('.simple-message-tooltip');
            var tipInner = $('.simple-message-tooltip .message');

            var setTip = function (top, left) {
                var topOffset = tip.height();
                var xTip = (left - 50) + "px";
                var yTip = (top - topOffset - 40) + "px";
                tip.css({ 'top': yTip, 'left': xTip });
            };

            $this.click(function(){
                var offset = $(this).offset(); //Offset returns an object containing the properties top and left.
                var tLeft = offset.left;
                var tTop = offset.top;

                tipInner.html(messageTxt);
                setTip(tTop, tLeft);
            },
                function () {
                    tip.fadeIn("fast");
                    setTimeout(function(){
                        tip.fadeOut("fast");
                    }, 1000);
                }

            );    
        });

    };
} (jQuery)); 

By the moment is sort of working (you could say lol) but with some problems. Maybe you please help me to find out why?

This is a tooltip that appears when you click on a radiobutton.

My first problem is that I would like the text inside to be a SETTING that can be changed later in order to make the plugin more maleable…But by the moment the plugin is not bringing me the text =(

Also, It is not bringing the tooltip EXACTLY on top of the radiobutton that the user selects.

If you could help me I will be greatly gracefully!!!

This is the fiddle: http://jsfiddle.net/Vrfsx/9/

THANKS IN ADVANCE ALL!! =)
OrangeJuice.-

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:42:07+00:00Added an answer on May 27, 2026 at 5:42 am

    You’re pretty close to having it working. The only thing you need to change is your click handler. The following:

    $this.click(function(){
        var offset = $(this).offset(); //Offset returns an object containing the properties top and left.
        var tLeft = offset.left;
        var tTop = offset.top;
    
        tipInner.html(messageTxt);
        setTip(tTop, tLeft);
    },
    function () {
        tip.fadeIn("fast");
        setTimeout(function(){
        tip.fadeOut("fast");
        }, 1000);
    });   
    

    Is incorrect; the first function will never be executed (due to an overload of click with two arguments, the last being an event handler) existing. All you should have to do to correct this is merge the two functions:

    $this.click(function() {
        var offset = $(this).offset();
        var tLeft = offset.left;
        var tTop = offset.top;
    
        tipInner.html(settings.messageTxt);
        setTip(tTop, tLeft);
        tip.fadeIn("fast");
        setTimeout(function() {
            tip.fadeOut("fast");
        }, 1000);
    });
    

    Updated code: http://jsfiddle.net/Bky7F/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very often when working on an ASP.NET web site, the options View Code and
Very odd problem as this is working perfectly on our old Classic ASP site.
I got this very newb and simple function in erlang: function_x(L) -> X =
I have done a very simple gallery using: $('#thumbs img').click(function(){ $('#mainimg img').attr('src',$(this).attr('src').replace('thumb','large')); }); but
Very similar to this question , except for Java. What is the recommended way
I found something very odd today: If you create objects with a constructor function
I'm fairly new to asp.net/c# and very new to jQuery so please forgive me
This could very well be a basic question - but I was unable to
I am writing my code like this: function updates_cb() { in a while loop
In this very simplified and minimized example click event handler has been defined for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.