jQuery anchor jump scroll bar smooth scrolling one sentence code
$(" html,body").animate({scrollTop: $("#box").offset().top}, 1000);
Here are some jquery tips1. Control the compilation results
<%if (false) { %>
<%}%>
2.
1 .If you want to use the functions provided by jQuery, you must first construct a jQuery wrapper set.
Convert the Dom element into a jQuery wrapper set
var div = document.getElementById("testDiv"); //Dom element
var domToJQueryObject = $(div); //jQuery packaging
3.jQuery wrapper set to DOM object
var domObject = $("#testDiv")[0]; // Get the DOM object
$("#testDiv").each(function() { $(this).html("Modify Content") })//Convert to jQuery wrapper set operation
4.
jQuery( callback )
Returns: jQuery
Abbreviation of $(document).ready()
----------------------------- -------------------------------------------------- -
Learn jQuery from scratch (3) Manage jQuery packaging set
Statement: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