Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Tooltips can greatly improve the usability of your web site by providing direction and cues to visitors. In this course, Chris Converse shows how to convert text or graphics into a mouse-sensitive tooltip. The tutorials demonstrate how to create the markup in Dreamweaver and activate the tooltip with jQuery, as well as add positioning and effects.
So any of the instructions inside up here aren't going to run until all of the HTML has been loaded. Now once the HTML has been loaded, the first thing we want to do is search through the HTML elements, and find any HTML element that's got a tooltip class assigned to it. So we'll do that by starting with the dollar sign, parentheses, two tick marks inside for a string literal. Inside of the string literal we're going to search for .tooltip. Outside of the parentheses, we're going to type .mouseover, beginning and ending parentheses, outside of the parentheses .mousemove, another set of parentheses .mouseout, another set of parentheses, then a semicolon.
So now we're attaching three properties to every tooltip that we find; a mouseover, a mousemove, and a mouseout. Inside of the first set of parentheses, let's come in here and add a function. So we'll type function, beginning and ending parentheses, beginning and ending bracket, and inside of the parentheses we're going to put a little letter e. This is going to capture information about the actual event that's triggering this. So the mouseover event here is going to be captured inside of this function. Let's copy this function, plus the parentheses, plus the e, plus the brackets, copy that to the clipboard.
Let's paste that inside of each of the other two sets of parentheses. Once we have all of these in place, let's come over here and just split these open. This is going to make it a little easier for us to see where we're actually putting our instructions, and then these two should be tabbed in. So now that we're finding all of the elements with the tooltip class and assigning three mouse functions, next we can work on detecting the actual type of tip that's triggering this, and then set the HTML of the tooltip container.
There are currently no FAQs about Create a Tooltip with jQuery and Dreamweaver.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.