I've never made a public API before. Feedback on this one?
helpbubble.com
helpbubble.com
var oldonload = window.onload;
Try to avoid touching the global namespace. At most register one object in it: HelpBubble. Use callbacks for the init, open, close, and clicked events. Look at how jQuery does it.These are too long:
HelpBubble.API.setText()
HelpBubble.API.setMenuStyle()
HelpBubble.API.setButtonStyle()
I would use: HelpBubble.API.text()
HelpBubble.API.menuStyle()
HelpBubble.API.setButtonStyle()
Passing it nothing should return the current value (for the latter two it should return objects). Setting it should take either objects or strings.Also, do you expect to only have one instance of these at a time? If not, your API might not work very well.
$("#element").html($("#element").html() + custom_html);
Allow me to explain. An API is a pretty abstract thing. For it to be useful, you need to have a use-case for it. Generally, once you've defined what the problem is that you're solving, you know about 80% of what the API needs to look like. The rest is just a matter of iteration and trial and error.
The best way to get at this is to write an application that uses the API. This should give you a pretty good idea of what kind of interface should be provided. Alternatively, your customers should give you an idea of what they want the API to do. Don't be afraid to ask probing questions if their needs are ambiguous.
Chrome 5.0.375.70 on "" also has the text flowing past the right side, but the header bg doesn't.
I suspect the issue is you UL is 100% width, plus padding, but I'm no CSS whiz.
Cool idea though and good question, I've been curious about how to make a public API as well.