Mobile phone H5 click category to automatically locate the corresponding content, h5 category

Source: Internet
Author: User

Mobile phone H5 click category to automatically locate the corresponding content, h5 category

_ Obj = {};
/* Click the pop-up category */
_ Obj. openZZ = function (){
Document. getElementById ("app_screen01"). style. display = "block"; // The mask layer is displayed when the category is displayed.
_ Box_object.shownavigation (); // category animation pop-up effect
}
/* Click "Hide category */
_ Obj. openZZ2 = function (){
Document. getElementById ("app_screen01"). style. display = "none"; // hide the mask layer when category is hidden
_ Box_object.hidenavigation (); // hide a category
}

$ ("# Ul_type_id li"). on ("click", function (){
_ Obj. openZZ2 ();
Var scroll_offset = $ ("#" + $ (this). attr ("alt"). offset ();
$ ("Body, html"). animate ({
ScrollTop: scroll_offset.top-50 // Let the body's scrollTop is equal to the top of the pos, it implements the Rolling
},500 );
});

Related Article

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.