Looking for a mouseover feature like stackoverflow

后端 未结 5 1036
心在旅途
心在旅途 2021-02-11 07:14

I love the hover effects of StackOverflow.

\"enter

I want to use similar feature

5条回答
  •  温柔的废话
    2021-02-11 08:08

    The new jQuery UI tooltip is quite good: http://jqueryui.com/tooltip/#custom-style

    The animation is controllable, the tooltip is styleable, you can pretty much mimic the StackOverflow like tooltips.

    Note that i linked you the "custom style" example. It shows you how to make custom styles for the tooltip.

    Also that by default the tooltip shows the title attribute of an element. There is an example: http://jqueryui.com/tooltip/#custom-content where custom content is set in different ways to show you a few options.

    I'm not sure what feature is missing.

    EDIT: the custom content demo is bugged on the example site, check it in full page view: http://view.jqueryui.com/menubar/demos/tooltip/custom-content.html

    EDIT2: New Solution

    Looking at Anton's answer I thought that this could be done correctly by adding the tooltip's div inside the original div, and introducing hoverintent. Also a little sanitization of the code was in order. Check: http://jsbin.com/anegip/2/edit

    http://jsbin.com/anegip/3/edit

    With a little design, it's what you want.

提交回复
热议问题