In most cases, locating a specific element through a tag is not accurate, so in most cases we need to do it through jquery. The code is as follows:
<DivClass= "NAV" ><Divclass= "Main Clearfix" ><AClass= "left"target= "_blank"id= "Logo"href= "/" > Exhibition video </A><UlClass= "Right" ><li><Ahref= "javascript:void (0);"Data-dire= "Intro_item_activ" > Event Introduction </a></Li><li><Ahref= "javascript:void (0);"data-dire= "Intro_item_teach" > Instructor Introduction </a></li><li><a href= "javascript:void (0);" data-dire= "intro_item_procedure" > Activity Flow </a></< Span class= "End-tag" >li><li><a Span class= "Attribute-name" >class= "btn_purchase" href= "javascript:void (0);" > Register now </a></li></ ul></div></DIV>
The following JS code is implemented:
$ (". Nav li A:not (': Last ')"). Click (function () {var dire=$ (this). Data ("dire"); $ ("body,html"). Animate ({ scrolltop : $ ("#" +dire). Offset (). top-74 },0);})
jquery navigates to the specified element