Hello, in this jQuery video, I'm going to show you the mouse leave event that we got the mouse and prevent and just locate recap, my center is triggered when your mouse enters the, you know, essentially the area that element, you know, cuz this is all you know has on your page. So do that. And for Dave, the block level element therefore is span the entire page. I can do it here as well because technically it is there even though the text isn't there. Okay, so the mostly, I can guess what that is. I'm just gonna apply it to the Dave principle is the same for anything that you select.
Do mostly function I'm just gonna say Really well exit to the word leave the winner have a quick enough look. yeah boy for you know the actual leaf that you get on the tree. So exited it through the woods. Okay? So if we were to go into it, and if I, you know, go off it go into a go off it and same with the law so that way we can check when our mouse has hovered on it when the mouse has hovered off it, okay, so the use case for this use case could be to highlight an object for example. So what I'm going to do is highlight it here.
And this is where you really going to see the benefit of having a complimentary mouse leave. Because if I do actually leaving the console logs in, it doesn't really matter. I'm just gonna move on. For the CSS of the elements, this is just the particular one that is selected from this event dot CSS. Again, I'm going to have a separate video covering CSS. So bear with me.
And just know that this code is covered in this video. So this is color red. And now if I reload it, as you can see, but watch what happens. They all turn red. And all let me just reload it. If I hover over diff three, and I go up here, though the mouse leave event world code because we didn't do anything it remained ready.
You might want that but chances are I produce something that's changing the style or animating it, you'll probably want to reverse it. That's where the mouse leave really comes into play. So if I was just taking Yeah, like instead, now if I run it, as you See, that looks a lot better. Now that looks pretty darn cool. So that's how you use the nicely function. You can do whatever functionality in JavaScript jQuery that you want here.
This is just a simple example. In the next video, I'm going to show you the map nice hava which essentially combined both of these methods into 1pm. Any questions, feel free to pop me a message and an extra task will want you to do we have together applied a CSS of colossal red and black or just turn red and black depend not mouse's on it or not. We do something similar for underlining. So if you're hovering over it, it underlines the text. If you're not, then it doesn't underline it.
For more sort of CSF tips and just how to use those features. I'll recommend having a look at those videos in this series. That's it. Thanks for watching, and I look forward to seeing you in the next video.