File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 55
55
tooltipClass : "ui-state-highlight"
56
56
} ) ;
57
57
58
- $ ( "#button1" ) . button ( ) . tooltip ( ) ;
58
+ var positionOnTop = {
59
+ position : {
60
+ my : "center bottom" ,
61
+ at : "center top" ,
62
+ offset : "0 -5"
63
+ }
64
+ } ;
65
+ $ ( "#button1" ) . button ( ) . tooltip ( positionOnTop ) ;
59
66
$ ( "#button2" ) . button ( {
60
67
icons : {
61
68
primary : "ui-icon-wrench"
62
69
}
63
- } ) . tooltip ( ) ;
64
- $ ( "#button3" ) . button ( {
70
+ } ) . tooltip ( positionOnTop ) ;
71
+ $ ( "#button3, #button4 " ) . button ( {
65
72
icons : {
66
73
primary : "ui-icon-wrench"
67
74
} ,
68
75
text : false
69
- } ) . tooltip ( ) ;
76
+ } ) . tooltip ( positionOnTop ) ;
70
77
}
71
78
enable ( ) ;
72
79
136
143
137
144
< button id ="button1 " title ="Button Tooltip "> Button Label</ button >
138
145
< button id ="button2 " title ="Icon Button "> Button with Icon</ button >
139
- < button id ="button3 "> Icon Only Button</ button >
146
+ < button id ="button3 "> Icon Only Button 1</ button >
147
+ < button id ="button4 "> Icon Only Button 2</ button >
140
148
141
149
< div id ="footnote "> This is < strong > the</ strong > footnote, including other elements</ div >
142
150
143
151
< button id ="disable "> Toggle disabled</ button >
144
152
< button id ="toggle "> Toggle widget</ button >
145
153
</ div >
146
154
155
+ < div style ="height: 2000px "> </ div >
147
156
148
157
</ body >
149
158
</ html >
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ $.widget("ui.tooltip", {
104
104
this . tooltip . css ( {
105
105
top : 0 ,
106
106
left : 0
107
- } ) . position ( $ . extend ( this . options . position , {
107
+ } ) . show ( ) . position ( $ . extend ( this . options . position , {
108
108
of : target
109
- } ) ) ;
109
+ } ) ) . hide ( ) ;
110
110
111
111
this . tooltip . attr ( "aria-hidden" , "false" ) ;
112
112
target . attr ( "aria-describedby" , this . tooltip . attr ( "id" ) ) ;
You can’t perform that action at this time.
0 commit comments