In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail "how to use JavaScript and jQuery to make light rod effect". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use JavaScript and jQuery to make light stick effect" can help you solve your doubts.
Use javaScript to make light stick effect
First of all, javaScript.
$(function () {var lis = document.getElementsByTagName ("li"); / / defines the DOM variable to accept the element for labeled li (var I = 0; I < lis.length;i++) {lis.onMouseover = function () {/ / mode-1 / / this.style.backGround = "pink" / / 1, note that the this method can only be used as the current traversal item of the for loop / / this.style.fontSize = "50px"; / / 2, the appended style after style can only be named by camel nomenclature / / method 2 this.style.cssText = "background-color:red;font-size:50px";} Lis.onmouseout = function () {/ / Mode 1 / / this.style.background = ""; / / this.style.fontSize = "20px"; / / Mode 2 this.style.cssText = "background-color:;font-size:20px";})
Compared with the two methods, .cssText is relatively simple.
Use jQuery to make light stick effect
$(function () {("li") .hover (function () {/ / the compound event is called here to simulate the mouse hover event $(this) .css ({"background-color": "red", "font-size": "50px"}) }, function () {$(this) .css ({"background-color": "", "font-size": "20px"}); / / directly append CSS style});}) Read this, this article "how to use JavaScript and jQuery to make light stick effect" article has been introduced, want to master the knowledge of this article still need to practice and use to understand, if you want to know more related articles, welcome to follow the industry information channel.
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.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.