


jQuery implements the effect of marking the current menu position (background highlight menu) after clicking_jquery
May 16, 2016 pm 03:43 PMThe example in this article describes the jQuery effect of marking the current menu position (background highlight menu) after clicking. Share it with everyone for your reference. The details are as follows:
This is a jquery menu effect that highlights the background after clicking, and is a personalized menu effect. I have seen many menus on the Internet, but it is rare to see such a simple method to implement it. This menu is overall simple. After clicking any menu item on the navigation bar, the background of the menu item turns to black, and the mouse moves After leaving, it remains fixed and remains black, remembering the location of the menu.
The operation effect is as shown below:
The online demo address is as follows:
http://demo.jb51.net/js/2015/jquery-menu-set-focus-style-codes/
The specific code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jquery點擊后高亮背景的菜單特效</title> <style> *{ margin:0; padding:0; list-style:none;} body{ font:normal 14px/24px 'MicroSoft YaHei';} .cotrs{ width:960px; height:32px; line-height:32px; background:#999; margin:0 auto;} .cotrs a{ height:32px; line-height:32px; color:#fff; text-decoration:none; padding:0px 10px; display:block; float:left;} .cotrs a:hover{ text-decoration:none; background:#000;} .cotrs a.thisclass{text-decoration:none; background:#000;} </style> </head> <body> <br><br><br> <div class="cotrs"> <a href='javascript:' class="thisclass">首頁</a> <a href='javascript:'>菜單導航</a> <a href='javascript:'>時間日期</a> <a href='javascript:'>焦點圖</a> <a href='javascript:'>tab標簽</a> <a href='javascript:'>jquery特效</a> <a href='javascript:'>在線客服</a> <a href='javascript:'>廣告代碼</a> <a href='javascript:'>相冊代碼</a> <a href='javascript:'>圖片特效</a> <a href='javascript:'>名站特效</a> <a href='javascript:'>其他代碼</a> <a href='javascript:'>HTML5</a> </div> <script src="jquery-1.9.1.min.js"></script> <script> $(function(){ var cotrs = $(".cotrs a"); cotrs.click(function(){ $(this).addClass("thisclass").siblings().removeClass("thisclass"); }); }); </script> <div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';"> </div> </body> </html>
I hope this article will be helpful to everyone’s jquery programming design.

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

How to mark minesweeper? First, we need to familiarize ourselves with the marking method in Minesweeper. Normally, there are two common marking methods in Minesweeper games: flag marking and question mark marking. The flag mark is used to indicate that there are mines in the block and is a deterministic mark; while the question mark mark indicates that there may be mines in the block, but it is not deterministic. These two marking methods play an important role in the game, helping players to infer which blocks may contain mines, so as to effectively proceed to the next step. Proficient use of these marking methods can improve the player's success rate in the minesweeper game and reduce the risk of stepping on mines. Therefore, when playing the minesweeper game, if the player has mastered the flag mark and question mark mark, when the player is not sure whether there is a mine in a certain square, he can use the question mark mark to mark it.

There are many functions above, especially for maps that can mark multiple places. When we know some places, we will definitely use some punctuation functions, so that we can bring you a variety of different aspects. Some of the functions you mark will produce distance differences, that is, you can know how far away they are. Of course, some names and detailed information of the above places will also be displayed. However, many netizens may not be familiar with some of the above. The content information is not very clear, so in order to allow everyone to make better choices in various aspects, today the editor will bring you some choices in various aspects, so friends who are interested in ideas, If you are also interested, come and give it a try. Standard

Detailed explanation of jQuery reference method: Quick start guide jQuery is a popular JavaScript library that is widely used in website development. It simplifies JavaScript programming and provides developers with rich functions and features. This article will introduce jQuery's reference method in detail and provide specific code examples to help readers get started quickly. Introducing jQuery First, we need to introduce the jQuery library into the HTML file. It can be introduced through a CDN link or downloaded

Are you also using Baidu map software on your computer? But do you know how to mark Baidu map? The following article brings you the specific operation of Baidu map mark. Let us take a look below. After entering the Baidu map, click on the upper right corner to select the region, as shown in the figure. After selecting the region, select the tool in the map, as shown in the figure. Select the mark in the map, as shown in the figure. Mark the map you want to mark. Here we use the front of Xicheng District, Beijing. Take No. 33 Qingchang Hutong as an example. Just select and save as shown in the picture.

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on ??the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

How to remove the height attribute of an element with jQuery? In front-end development, we often encounter the need to manipulate the height attributes of elements. Sometimes, we may need to dynamically change the height of an element, and sometimes we need to remove the height attribute of an element. This article will introduce how to use jQuery to remove the height attribute of an element and provide specific code examples. Before using jQuery to operate the height attribute, we first need to understand the height attribute in CSS. The height attribute is used to set the height of an element
