Display a fixed "ToolTip" when an input receives focus, using jQuery -
I have a form that has many textboxes (input type = "text"). I would like to display some sort of tooltip when the text box gets focus and hide it when it loses focus. Ideally, tooltip should have "speech" bubbles on the left or right side.
I found a little mistake and found, but it seems that a plug-in for the tool tip is hovering over something, but I want it.
Try to force my text into a text box:
$ (function () {$ ("input [id $ = tbMyTextbox]"). Qtip ({ Content: 'My tooltip text'});});
(The selector works, I am not using the # TBMITx box because it is ASP.NET, and I do not use the & lt;% = tbMyTextBox.ClientID%> Because I have no code, I have a .aspx file, but that off-topic-selector works with other stuff itself, so I think it's okay.)
Can someone give me a hint about how this can work or I have a separate JQuery plugin that does this?
Thank you:
EDIT: Thanks, Show Event is Going!
$ ("Input [id $ = {TBMITx box]"). Qtip ({content: 'test', position: {corner: {target: 'right middle', tooltip: 'leftMiddle'}}, show: {when: {event: 'focus'}}, hide: {when: { Incident: 'Blurred'}}});
You manually assign your tooltip to display: none
focus The event will be displayed in the handler.
$ ("input [id $ = tbMyTextbox]"). Focus (function () {$ ("div [id $ = tooltip]"). Show ();}); $ ("Input [id $ = tbMyTextbox]"). Blur (function () {$ ("div [id $ = tooltip]"). Hide ();});
Another possibility is probably using the option to show in qTip I have never used kypt, so this is purely theoretical at my end, but you should be able to show the : {when: {event: 'focus'}}
in options.
Comments
Post a Comment