Similar to Baidu News:
When I first entered Baidu News, the homepage was selected by default.
And when I click on the Internet, the hyperlink of the Internet is selected.
How is this technology implemented? Is there any place to study? Can you give me a general idea?
I took a look and this is what Baidu does: add class=current
to the selected tag and then The css file contains:
menu-list .current a { color: #304E80; border-bottom: 3px solid #3064BB; text-decoration: none;}
changes its own style when clicked, and changes the styles of all other li's at the same time!
I took a look and this is what Baidu does: add class=current
to the selected tag and then the css file contains:
menu-list .current a { color: #304E80; border-bottom: 3px solid #3064BB; text-decoration: none;}
You make 2 pages
One page, the home page is selected
One page, the Internet is selected
Then the Internet inside the home page Click to jump to the Internet page
You make 2 pages
One page The home page is selected
One page The Internet is selected
Then click on "Internet" in the "Home Page" to jump to the "Internet Page"
http://www.96kb.com/uploadfile/201311/6152345.zip
Check out the complete demo! Same as Baidu News!
a:active
You make 2 pages
One page The homepage is selected
One page Internet It is in the selected state
and then click on Internet in the home page to jump to the Internet page
You can write it with jq. When the mouse passes over the Internet, add the .current class and other brothers delete the class