20150722---Click the button to make the specified control visible partial translation (JS)

Source: Internet
Author: User

Previous section code:

<DivID= "Out"style= "Width:400px;overflow:hidden;">        <DivID= "int"style= "white-space:nowrap;width:800px;">            <Asp:labelID= "Lbltable"runat= "Server"Text= "Label"></Asp:label>        </Div>    </Div>      <labelonmousedown= "Marqueebyid (' l ', ' Out ')"onmouseup= "Marqueestop ()">&lt;&lt;&lt;&lt;</label>    <labelonmousedown= "Marqueebyid (' R ', ' Out ')"onmouseup= "Marqueestop ()">&gt;&gt;&gt;&gt;</label>

Note: The inner div width is larger than the outer div, and the width setting is not limited to the actual pixel, but also the percentage; JS points to the outer Div. The outer div inner element is outside the partially hidden Overflow:hidden, and the text of the inner Div does not allow line wrapping White-space:nowrap

Background:

protected voidPage_Load (Objectsender, EventArgs e) {ShowMenu ( -); }        Private voidShowMenu (intm) {stringStrtable ="";  for(inti =0; I <= m; i++) {strtable+="<a href=\ "# \" class=\ "nav\" ><span>"+ i +"</span></a>"; } Lbltable.text=strtable; }

Note: The auto-generated menu bar;

Javascript:

varSpeed = 10;//The higher the number, the slower the speed .varGetId;//the control ID that needs to be movedvarMymark;//Switch MarkersfunctionMarqueebyid (direction,id) {getId=document.getElementById (ID); Direction= = "R"?moveright (): MoveLeft ();}functionMarqueestop () {clearinterval (Mymark);}functionMoveRight () {Mymark= SetInterval (function() {getid.scrollleft++}, speed);}functionMoveLeft () {Mymark= SetInterval (function() {getid.scrollleft--}, speed);}

Effect Show:

Click on the right arrow:

Click Left:

20150722---Click the button to make the specified control visible partially translated (JS)

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.