In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use $this.index () in jQuery, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
JQuery $this.index () use case
Case study:
A case study of Taobao clothing
1. Core principle: exclusive thinking, the mouse over the left box of a li so that the content area of the box corresponding to the picture display, the rest of the picture hidden.
two。 If you need to get the current small li index number, you can display the picture of the corresponding index number.
3. JQuery gets the current element index number $this.index ()
4. The corresponding picture in the middle can be selected by eq (index) method
5. Show element (show) Hidden element hide ()
$(function () {/ / 1. Mouse over the small $("# left li") .onMouseover (function () {/ / 2. Get the current small li index number var index = $(this). Index (); / / 3. Let the box on the right show the corresponding index number $("content div") .eq (index) .show (); / / 4. Let the rest of the pictures hide $("content div") .eq (index) .sibings () .hide () })}) Thank you for reading this article carefully. I hope the article "how to use $this.index () in jQuery" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.