How to break line in jQueryUI tooltip

后端 未结 4 1014
半阙折子戏
半阙折子戏 2021-02-05 03:35

The new version of jQueryUI (1.9) comes with the native tooltip widget. After testing with it, it works fine if the content (value of the title attribute) is short. But if the c

4条回答
  •  忘掉有多难
    2021-02-05 03:48

    This works:

    HTML

    AB PNEU 700 X 23 FOLD CORPRO

    JavaScript

    $(document).tooltip({
        content: function() {
            var element = $( this );
            if ( element.is( "[title]" ) ) {
                return element.attr( "title" );
            }
        },
        position: {
            my: "center bottom-20",
            at: "center top"
        }
    });
    

提交回复
热议问题