/*change the color of the search block*/functionsearch () {varSearchBox = Document.queryselector ('. M_head ')); varBannerbox = Document.queryselector ('. M_banner ')); varClassify =$ ('. M_classify a '); varNews = $ ('. Home_news a '); varOinput =$ ('. M_head. M_search INPUT.INPUT_BG '); varh =Bannerbox.offsetheight; Window.onscroll=function(){ vartop =Document.body.scrollTop; varopacity = 0.2; if(Top < H/2) {opacity = top/h * 0.95; Classify.removeclass (' Classify_h_ico '). addclass (' Classify_ico ')); News.removeclass (' News_h_ico '). addclass (' News_ico ')); Oinput.css ("Border", "none"); }Else{opacity= 0.98; Classify.removeclass (' Classify_ico '). addclass (' Classify_h_ico ')); News.removeclass (' News_ico '). addclass (' News_h_ico ')); Oinput.css ("Border", "1px solid #eee"); } searchBox.style.background= "Rgba (255,255,255," +opacity+ ")"; }}
<Divclass= "M_head"> <Divclass= "M_classify"> <ahref= "javascript:void (0);"OnClick= "Showclass (', this);"Status= ' 0 'class= "Classify_ico"></a> </Div> <Divclass= "M_search"> <formname= "Theform"ID= "Theform"Action=""Method= "POST"> <inputtype= "text"name= "keyword"ID= "keyword"placeholder= "Search for goods, stores"class= "INPUT_BG"> <aclass= "Home_login"href= "javascript:void (0);"OnClick= "Javascript:jquery" (' #theForm '). Submit (); "></a> </form> </Div> <Divclass= "Home_news"> <ahref=""class= "News_ico"></a> </Div> </Div>
JQuery Homepage search area module changes with the page sliding