![]() So let me go back here and just execute the center image function and pass it along to large image. And the overlay looks really good but the image is not centered. And I'll pull up one of these images, resize my window. ![]() I'm going to make my window smaller again. (SOUND) And we also need to adjust the position of the top and left of the overlay. (SOUND) Of course, it's going to be inner height. (SOUND) We're going to do a similar thing with the height. So, my overlay style, we're going to change the style attributes width and we're going to make that to the window inner width plus the pixel measurement. Once again, we're going to make sure that the overlay exists. So this time, the event that I want to look for is called resize and, of course, like before, I want to execute a function and pass it along false to make sure that it bubbles properly. I'm going to go enter my code and, right over here, I'm going to add a listener for another window event. But if I resize my window now, you can see that it doesn't look good because the overlay doesn't stretch to the whole width of the window. If you resize this window for any reason and then I'm going to click on one of these, it looks great. ![]() But there's a slight problem that we need to take care of. It must be an instance of eRef or React.This project is working and looking great. Use this prop to pass a reference to the element you want to attach resize handlers to. These options will be used as a second parameter of resizeObserver.observe method. Please refer to lodash's docs for more info
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |