Javascript-based logo image prompting effect code _ javascript tips-JS tutorial

Source: Internet
Author: User
This article mainly introduces the code of the logo image prompting effect implemented by JS, and involves implementation techniques related to page element traversal modification triggered by JavaScript mouse events. It has some reference value, if you need it, refer to the example in this article to describe the effect of the logo image prompts implemented by JS. Share it with you for your reference. The details are as follows:

This is a JavaScript-based mouse tip effect. The car Logo displays the tip effect-when the mouse moves, the logo image is displayed. the logo is not displayed after the page is opened, only when the mouse moves on the logo, the logo suddenly appeared. Similar to Js prompts for special effects, the compatibility of this Code is also well written, and the code is not complicated. Most of them call images.

The running effect is as follows:

The Online Demo address is as follows:

Http://demo.jb51.net/js/2015/js-car-ico-alert-style-demo/

The Code is as follows:

 Prompt box effect-logo display prompt effectScript window. onload = function () {var oLi = document. getElementsByTagName ("li"); var oA = document. getElementsByTagName ("a"); var oImg = document. getElementsByTagName ("img"); for (var I = 0; I <oLi. length; I ++) {oA [I]. index = oImg [I]. index = I; oA [I]. onmouseover = function () {oLi [this. index]. className = "zindex"; oImg [this. index]. style. display = "block"}; oA [I]. onmouseout = function () {oLi [this. index]. className = ""; oImg [this. index]. style. display = "none"}; oImg [I]. onmouseover = function () {oLi [this. index]. className = "zindex"; this. style. display = "block"}; oImg [I]. onmouseout = function () {oLi [this. index]. className = ""; this. style. display = "none" }}} script

Vehicle logo display-move the mouse over to display the logo

  • BMWBMW
  • Alfa RomeoAlpha romio
  • SkodaSkoda
  • VolkswagenVolkswagen
  • SaabSabb car
  • LamborghiniLamborghini
  • PorschePorsche
  • PeugeotPeugeot
  • Mercedes1Mercedes
  • BuickBuick Motor

I hope this article will help you design JavaScript programs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.