Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 96766 Viewers
56 Video lessons · 110467 Viewers
71 Video lessons · 79299 Viewers
131 Video lessons · 38041 Viewers
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.