In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to highlight selected elements in jQuery". In daily operation, I believe that many people have doubts about how to highlight selected elements in jQuery. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to achieve highlighted selected elements in jQuery". Next, please follow the editor to study!
Today, I met a request to help a senior sister to build a web page:
If the mouse is not moved into the table, the transparency of the table remains unchanged.
Move the mouse into the table, hover to the cell transparency unchanged, no hover to the cell transparency change.
First post I have achieved good results, at first, the transparency of the form remains the same.
When I move my mouse to the third cell in the second row, the other cells reduce the transparency.
Solution method
At first, I used the CSS implementation, which looks like this
# table td {opacity:0.5;} # table td:hover {opacity:1;}
But at the beginning, the transparency of the form is 0.5, which doesn't look good.
Later, I used jQuery's hover method, but it always selects all the cells in it, and the process is very tortuous, so I won't introduce them one by one. I'll talk about how I achieve it.
Hover (function () {$('# content td'). Css ('opacity','0.5'); $(' # content td:hover'). Css ('opacity','1');}, function () {$(' # content td'). Css ('opacity','1');})
Content is the id name of my table. You can see that we have added two function to the cell hover method.
When the first funtion is moved to the table, the chief
$('# content td'). Css ('opacity','1')
Indicates that when the mouse is moved in, the transparency of all cells is 0.5, and then
$('# content td:hover'). Css ('opacity','1')
Here, css's hover selector indicates that a single cell is selected.
The second funtion indicates that when the mouse leaves the table
At this point, the study on "how to highlight the selected elements in jQuery" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.