RandomlyKnighted's Profile User Rating: -----

Reputation: 117 Stalwart
Group:
Authors
Active Posts:
1,364 (0.81 per day)
Joined:
14-January 10
Profile Views:
53,711
Last Active:
User is offline Today, 09:43 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Your Car:
Ford
Dream Kudos:
300

Latest Visitors

Icon   RandomlyKnighted chilling at home working on a jQuery plugin :D

Posts I've Made

  1. In Topic: Value of data attribute always empty

    Posted 23 Aug 2014

    I see what you mean about that. Unfortunately I can't use $(this) as it selects the element that I'm hovering over instead of the actual tooltip, because I'm adding the tooltips dynamically. Of course what I had might have worked if I was adding the tooltips to the page only when their elements are hovered over.
  2. In Topic: Value of data attribute always empty

    Posted 23 Aug 2014

    Ok, so in order to account for when the user specifies the position of the tooltip via the data-attribute I added an if statement that check to see if the user has declared the position and if they have then it changes the follow to false. Here's what I did:

    $.fn.tooltip = function(userOptions)
    	{
    		var defaultOptions =	{
    									position: '',
    									follow: true
    								};
    
    		options = $.extend(defaultOptions, userOptions);
    
    		var position = $(this).data('position');
    		if (position != undefined)
    		{
    			options.position = position;
    			options.follow = false;
    		}
    
    		element = $(this);
    		title = element.attr('title');
    		element.on("mouseenter", element, _mouseEnter);
    	}
    
    


    I believe that puts me a step in the right direction. Something I hadn't noticed until just now is that no matter which tooltip I hover over the text in the tooltip is always the text of the very first anchor that I'm getting the title from.
  3. In Topic: Value of data attribute always empty

    Posted 22 Aug 2014

    Yeah, that line was from the original version of the project, before I changed it to have my own mouseenter and mousemove functions. Actually, I just realized that in this function

    $.fn.tooltip = function(userOptions)
    	{
    		var defaultOptions =	{
    									position: '',
    									follow: true
    								};
    
    		options = $.extend(defaultOptions, userOptions);
    
    		element = $(this);
    		title = element.attr('title');
    		element.on("mouseenter", element, _mouseEnter);
    	}
    
    


    I'm getting the user defined options, but I don't have anything to account for when I use the data-position attribute instead of passing the position in via the function call.
  4. In Topic: Value of data attribute always empty

    Posted 22 Aug 2014

    I have a script.js file with the following line that calls the code:

    $('a').tooltip();
    
    


    Right, I'm trying to figure out the best way to make that available to the build function now.
  5. In Topic: Value of data attribute always empty

    Posted 22 Aug 2014

    I'm just running it in my Firefox browser.

My Information

Member Title:
D.I.C Lover
Age:
23 years old
Birthday:
June 11, 1991
Gender:
Location:
Albertville, AL
Years Programming:
4
Programming Languages:
ASP.NET, C#, Java, SQL

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://randomlyknighted.com
LinkedIn:
http://www.linkedin.com/in/thughes01
Twitter:
tyler_b_hughes

Comments

Page 1 of 1
  1. Photo

    ishkabible Icon

    26 Jun 2011 - 18:13
    happy belated birthday!!
  2. Photo

    chinalwb Icon

    07 Jun 2011 - 21:33
    Your birthday is coming, Happy Birthday to You~!
  3. Photo

    no2pencil Icon

    11 Apr 2011 - 19:57
    GO BLUEJAYS!
  4. Photo

    Dogstopper Icon

    05 Nov 2010 - 03:58
    GO BRAVES!
Page 1 of 1