-
Recent Comments
-
Feature Posts
-
BMI
(function($){ $.fn.colorTip = function(settings){ var defaultSettings = { color : 'yellow', timeout : 200 } var supportedColors = ['red','green','blue','white','yellow','black']; /* Combining the default settings object with the supplied one */ settings = $.extend(defaultSettings,settings); /* * Looping through all the elements and returning them afterwards. * This will add chainability to the plugin. */ return this.each(function(){ var elem = $(this); // If the title attribute is empty, continue with the next element if(!elem.attr('title')) return true; // Creating new eventScheduler and Tip objects for this element. var scheduleEvent = new eventScheduler(); // Set closebutton if alert of a previous action var after = ''; /* if(elem.attr('data-close')){ after = ' ✖'; } */ var tip = new Tip(elem.attr('title')+after); // Adding the tooltip markup to the element and // applying a special class: elem.append(tip.generate()).addClass('colorTipContainer'); // Checking to see whether a supported color has been // set as a classname on the element. var hasClass = false; for(var i=0;i'+this.content+ '')); }, show: function(){ if(this.shown) return; // Center the tip and start a fadeIn animation this.tip.css('margin-left',-this.tip.outerWidth()/2).fadeIn('fast'); this.shown = true; }, hide: function(){ this.tip.fadeOut(); this.shown = false; } } })(jQuery);Labels
- tech news (1)
-
Twitter Feed
- Loading Tweets..
-
Recent Posts