开发者

a hideable and 'recyclable' javascript context toolbar

I am searching for plugins/scripts that provide a toolbar when hovering elements of a big list. Almost like in this question: JavaScript/HTML hover menu/toolbar

However, I don't want it to be a css-menu-like one. As I said, It will be a very big list and I would like its markup not to be duplicated n times. So I need a javascript that will move the same toolbar from list element to list element when they're hovered.

I know the YUI2 tooltip applies this strategy of moving the tooltip element, and changing the contents at display, but it's only for informative text displaying. I can't add buttons to it, and it's positionned accordin开发者_StackOverflow社区g to the actual mouse position, and not to the element hovered.

ps: I tagged this question jQuery because the project is using it but i'm open to any framework-dependant or not solution.


Something like this should work:

var toolbar = $('#toolbar');
$('#yourTable').delegate('.has-tooltip', 'mouseenter', function() {
    toolbar.insertBefore(this);
}).delegate('.has-tooltip', 'mouseleave', function() {
    toolbar.detach();
});

The delegate will trigger for those events on elements matching .has-tooltip which are inside #yourTable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜