What does this code mean? [Detailed explanation with pictures attached]_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:53:34
Original
1851 people have browsed it

Hello everyone~ I saw the following code when I was studying a website

This part of the code corresponds to the picture below. The character part in the picture is the link

When I clicked on the character in the picture, the website happened Jump (you can see that the URL has not changed)

What I don’t understand is how the jump is achieved? Or how to achieve this action?
And in the tag here, what does href="" mean? Does the tag have the data-page attribute?


Reply to discussion (solution)

Custom attributes, event control page display is added to the a tag

Custom attributes, event control page display is added on the a tag


In other words, the data-page is a custom attribute, saved in other files, right?
You said "the a tag has an event to control the page display", can you explain it in detail? I have just come into contact with html and many things are still unclear. . .


Custom attributes, event control page display is added to the a tag


That is to say, data-page is a custom attribute. Save it in another file, right?
You said "the a tag has an event to control the page display", can you explain it in detail? I have just come into contact with html and many things are still unclear. . .
<!DOCTYPE html><html><head><script src="/jquery/jquery-1.11.1.min.js"></script></head><body><a data-a="a">aaaaaaaaaa</a><a data-a="a1">aaaaaaaaaa</a><a data-a="a2">aaaaaaaaaa</a><a data-a="a3">aaaaaaaaaa</a><script>$('a[data-a]').click(function(){alert($(this).attr('data-a'))})</script></body></html>
Copy after login
Copy after login
Copy after login
Copy after login



Custom attributes, event control page display is added to the a tag


That is to say, data-page is a custom attribute and is saved in other files, right?
You said "the a tag has an event to control the page display", can you explain it in detail? I have just come into contact with html and many things are still unclear. . .

<!DOCTYPE html><html><head><script src="/jquery/jquery-1.11.1.min.js"></script></head><body><a data-a="a">aaaaaaaaaa</a><a data-a="a1">aaaaaaaaaa</a><a data-a="a2">aaaaaaaaaa</a><a data-a="a3">aaaaaaaaaa</a><script>$('a[data-a]').click(function(){alert($(this).attr('data-a'))})</script></body></html>
Copy after login
Copy after login
Copy after login
Copy after login


I understand what custom attributes mean! Thank you~
But what does href="" mean?




Custom attributes, event control page display is added to the a tag


That is, data -page is a custom attribute and is saved in other files, right?
You said "the a tag has an event to control the page display", can you explain it in detail? I have just come into contact with html and many things are still unclear. . .

<!DOCTYPE html><html><head><script src="/jquery/jquery-1.11.1.min.js"></script></head><body><a data-a="a">aaaaaaaaaa</a><a data-a="a1">aaaaaaaaaa</a><a data-a="a2">aaaaaaaaaa</a><a data-a="a3">aaaaaaaaaa</a><script>$('a[data-a]').click(function(){alert($(this).attr('data-a'))})</script></body></html>
Copy after login
Copy after login
Copy after login
Copy after login


I understand what custom attributes mean! Thank you~
But what does href="" mean?


This is to allow the mouse to move up to have hand shapes and other styles





Customized attributes, event control page display is added on the a tag


In other words, data-page is a custom attribute, saved in other files, right?
You said "the a tag has an event to control the page display", can you explain it in detail? I have just come into contact with html and many things are still unclear. . .

<!DOCTYPE html><html><head><script src="/jquery/jquery-1.11.1.min.js"></script></head><body><a data-a="a">aaaaaaaaaa</a><a data-a="a1">aaaaaaaaaa</a><a data-a="a2">aaaaaaaaaa</a><a data-a="a3">aaaaaaaaaa</a><script>$('a[data-a]').click(function(){alert($(this).attr('data-a'))})</script></body></html>
Copy after login
Copy after login
Copy after login
Copy after login

I understand what custom attributes mean! Thank you~
But what does href="" mean?
This is to allow the mouse to move up to have hand shapes and other styles
Thank you so much! !
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template