Comments (4)
Can't do it because when I have a string like:
new FloatingTips('myLink');
I have to choose to use it as selector or as element id. I cannot magically understood if a string is an element id or an elements selector :)
If you cannot live without new FloatingTips('myLink')
, try to add this at the end of my plugin code:
var RolfFloatingTips = new Class({
Extends: FloatingTips,
initialize: function(element, options) {
if (typeof(element) == 'string') {
this.parent('#' + element, options); // Call parent class
} else {
this.parent(element, options); // Call parent class
}
}
});
And then use:
new RolfFloatingTips('top');
from floatingtips.
Quick reply, nice..
I understand I can extend it to fit my own needs, I actually have that on the to-do for tomorrow :)
But I would suggest making it the default.
You could do something like:
elements = Array.from(document.id(elements) || $$(elements));
And work with that.. Slick will be able to parse a string selector with the $$(elements), so it would work if you throw in whatever really. (have to test to make sure of course).
or with document.getElements(selector) as the Slick demo does here: http://mootools.net/demos/?demo=Slick.Finder
Again, throw in whatever you want (string or element)..it'll just work and is more flexible. (correct me if I'm mistaken!)
from floatingtips.
I will try. If I'm not wrong, you say to give the string input to document.id
, and then if it returns an Element
, use it, else use the string as selector as before. Correct?
from floatingtips.
Closed because not applicable without changing constructor behavior.
If needed, extend the class as I suggested or edit sources.
from floatingtips.
Related Issues (19)
- Using multiple elements HOT 4
- Manual zIndex (as option) HOT 2
- Trigger On Event HOT 1
- The tooltip doesn't hide everytime HOT 8
- FloatingTip is not hidden when the element is disposed HOT 6
- Lacking 'sources' in package.yml HOT 2
- Suggestion: offset option callback-able HOT 2
- Show some alternative initialization in HowTo (README.md)
- passing Multiple objects as array fails HOT 2
- FloatingTips on imagemap area HOT 2
- bug when calling show before the show opacity effect is over HOT 4
- FloatingTips.js lacks a packager requires: directive HOT 3
- Provide a way to hideOn: 'memberPopup' or similar
- Hide tip on outside click HOT 4
- [BUG] Tips are always created on show HOT 4
- In IE, z-index is not set correctly from user CSS HOT 5
- Handling position of fixed positioned children HOT 4
- [FEATURE] Applying delegation to dynamically generated elements via AJAX HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from floatingtips.