ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
JB P10,MAIN1
JNB P10,$
MOV P0,#0FCH
SJMP MAIN
MAIN1:
JB P11,MAIN2
JNB P11,$
MOV P0,#0F3H
SJMP MAIN
MAIN2:
JB P12,MAIN3
JNB P12,$
MOV P0,#0CFH
SJMP MAIN
MAIN3:
JB P13,MAIN
JNB P1,3,$
MOV P0,#3FH
SJMP MAIN
END
<!--
/MSClass (Class Of Marquee Scroll通用不间断滚动JS封装类) Ver 165\
copyright qqlxinye
应用说明:页面包含<script type="text/javascript" src="MSClassjs"></script>
创建实例:
//参数直接赋值法
new Marquee("marquee")
new Marquee("marquee","top")
new Marquee("marquee",0,1,760,52)
new Marquee("marquee","top",1,760,52,50,5000)
new Marquee("marquee",0,1,760,104,50,5000,3000,52)
new Marquee("marquee",null,null,760,104,null,5000,null,-1)
//参数动态赋值法
var marquee1 = new Marquee("marquee") 此参数必选
marquee1Direction = "top"; 或者 marquee1Direction = 0;
marquee1Step = 1;
marquee1Width = 760;
marquee1Height = 52;
marquee1Timer = 50;
marquee1DelayTime = 5000;
marquee1WaitTime = 3000;
marquee1ScrollStep = 52;
marquee1Start();
参数说明:
ID "marquee" 容器ID (必选)
Direction (0) 滚动方向 (可选,默认为0向上滚动) 可设置的值包括:0,1,2,3,"top","bottom","left","right" (0向上 1向下 2向左 3向右)
Step (1) 滚动的步长 (可选,默认值为2,数值越大,滚动越快)
Width (760) 容器可视宽度 (可选,默认值为容器初始设置的宽度)
Height (52) 容器可视高度 (可选,默认值为容器初始设置的高度)
Timer (50) 定时器 (可选,默认值为30,数值越小,滚动的速度越快,1000=1秒,建议不小于20)
DelayTime (5000) 间歇停顿延迟时间(可选,默认为0不停顿,1000=1秒)
WaitTime (3000) 开始时的等待时间(可选,默认或0为不等待,1000=1秒)
ScrollStep (52) 间歇滚动间距 (可选,默认为翻屏宽/高度,该数值与延迟均为0则为鼠标悬停控制,-1禁止鼠标控制)
使用建议:
1、建议直接赋予容器的显示区域的宽度和高度,如(<div id="marquee" style="width:760px;height:52px;"></div>)
2、建议为容器添加样式overflow = auto,如(<div id="marquee" style="width:760px;height:52px;overflow:auto;"></div>)
3、为了更准确的获取滚动区域的宽度和高度,请尽可能将各滚动单位直接赋予正确宽高度
4、对于TABLE标记的横向滚动,需要对TABLE添加样式display = inline,如(<div id="marquee" style="width:760px;height:52px;overflow:auto;"><table style="display:inline"></table></div>)
5、对于翻屏滚动或间歇滚动,要注意各滚动单位间的间距,同时需要对容器的可视高度和可视宽度做好准确的设置,对于各滚动单位间的间距可以通过设置行间距或者单元格的高宽度来进行调整
6、对于LI自动换行的问题暂时没有更好的解决办法,建议将其转换成表格(TABLE)的形式来达到同等的效果
7、针对横向滚动的文字段落,如果最末端是以空格" "结束的,请将空格" "转换成" "
8、鼠标悬停滚动思想源自Flash,所以有一定的局限性(容器内仅允许用<img>或者带链接的<a><img></a>的形式,并需要禁止其自动换行)
\程序制作/版权所有:qqlxinyecn
function Marquee()
{
thisID = documentgetElementById(arguments[0]);
if(!thisID)
{
alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
thisID = -1;
return;
}
thisDirection = thisWidth = thisHeight = thisDelayTime = thisWaitTime = thisCTL = thisStartID = thisStop = thisMouseOver = 0;
thisStep = 1;
thisTimer = 30;
thisDirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3};
if(typeof arguments[1] == "number" || typeof arguments[1] == "string")thisDirection = arguments[1];
if(typeof arguments[2] == "number")thisStep = arguments[2];
if(typeof arguments[3] == "number")thisWidth = arguments[3];
if(typeof arguments[4] == "number")thisHeight = arguments[4];
if(typeof arguments[5] == "number")thisTimer = arguments[5];
if(typeof arguments[6] == "number")thisDelayTime = arguments[6];
if(typeof arguments[7] == "number")thisWaitTime = arguments[7];
if(typeof arguments[8] == "number")thisScrollStep = arguments[8];
thisIDstyleoverflow = thisIDstyleoverflowX = thisIDstyleoverflowY = "hidden";
thisIDnoWrap = true;
thisIsNotOpera = (navigatoruserAgenttoLowerCase()indexOf("opera") == -1);
if(argumentslength >= 7)thisStart();
}
MarqueeprototypeStart = function()
{
if(thisID == -1)return;
if(thisWaitTime < 800)thisWaitTime = 800;
if(thisTimer < 20)thisTimer = 20;
if(thisWidth == 0)thisWidth = parseInt(thisIDstylewidth);
if(thisHeight == 0)thisHeight = parseInt(thisIDstyleheight);
if(typeof thisDirection == "string")thisDirection = thisDirectionArray[thisDirectiontoString()toLowerCase()];
thisHalfWidth = Mathround(thisWidth / 2);
thisHalfHeight = Mathround(thisHeight / 2);
thisBakStep = thisStep;
thisIDstylewidth = thisWidth + "px";
thisIDstyleheight = thisHeight + "px";
if(typeof thisScrollStep != "number")thisScrollStep = thisDirection > 1 thisWidth : thisHeight;
var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
var msobj = this;
msobjtempHTML = msobjIDinnerHTML;
if(msobjDirection <= 1)
{
msobjIDinnerHTML = templateTopreplace(/MSCLASS_TEMP_HTML/g,msobjIDinnerHTML);
}
else
{
if(msobjScrollStep == 0 && msobjDelayTime == 0)
{
msobjIDinnerHTML += msobjIDinnerHTML;
}
else
{
msobjIDinnerHTML = templateLeftreplace(/MSCLASS_TEMP_HTML/g,msobjIDinnerHTML);
}
}
var timer = thisTimer;
var delaytime = thisDelayTime;
var waittime = thisWaitTime;
msobjStartID = function(){msobjScroll()}
msobjContinue = function()
{
if(msobjMouseOver == 1)
{
setTimeout(msobjContinue,delaytime);
}
else
{ clearInterval(msobjTimerID);
msobjCTL = msobjStop = 0;
msobjTimerID = setInterval(msobjStartID,timer);
}
}
msobjPause = function()
{
msobjStop = 1;
clearInterval(msobjTimerID);
setTimeout(msobjContinue,delaytime);
}
msobjBegin = function()
{
msobjClientScroll = msobjDirection > 1 msobjIDscrollWidth / 2 : msobjIDscrollHeight / 2;
if((msobjDirection <= 1 && msobjClientScroll <= msobjHeight + msobjStep) || (msobjDirection > 1 && msobjClientScroll <= msobjWidth + msobjStep)) {
msobjIDinnerHTML = msobjtempHTML;
delete(msobjtempHTML);
return;
}
delete(msobjtempHTML);
msobjTimerID = setInterval(msobjStartID,timer);
if(msobjScrollStep < 0)return;
msobjIDonmousemove = function(event)
{
if(msobjScrollStep == 0 && msobjDirection > 1)
{
var event = event || windowevent;
if(windowevent)
{
if(msobjIsNotOpera)
{
msobjEventLeft = eventsrcElementid == msobjIDid eventoffsetX - msobjIDscrollLeft : eventsrcElementoffsetLeft - msobjIDscrollLeft + eventoffsetX;
}
else
{
msobjScrollStep = null;
return;
}
}
else
{
msobjEventLeft = eventlayerX - msobjIDscrollLeft;
}
msobjDirection = msobjEventLeft > msobjHalfWidth 3 : 2;
msobjAbsCenter = Mathabs(msobjHalfWidth - msobjEventLeft);
msobjStep = Mathround(msobjAbsCenter (msobjBakStep2) / msobjHalfWidth);
}
}
msobjIDonmouseover = function()
{
if(msobjScrollStep == 0)return;
msobjMouseOver = 1;
clearInterval(msobjTimerID);
}
msobjIDonmouseout = function()
{
if(msobjScrollStep == 0)
{
if(msobjStep == 0)msobjStep = 1;
return;
}
msobjMouseOver = 0;
if(msobjStop == 0)
{
clearInterval(msobjTimerID);
msobjTimerID = setInterval(msobjStartID,timer);
}
}
}
setTimeout(msobjBegin,waittime);
}
MarqueeprototypeScroll = function()
{
switch(thisDirection)
{
case 0:
thisCTL += thisStep;
if(thisCTL >= thisScrollStep && thisDelayTime > 0)
{
thisIDscrollTop += thisScrollStep + thisStep - thisCTL;
thisPause();
return;
}
else
{
if(thisIDscrollTop >= thisClientScroll)
{
thisIDscrollTop -= thisClientScroll;
}
thisIDscrollTop += thisStep;
}
break;
case 1:
thisCTL += thisStep;
if(thisCTL >= thisScrollStep && thisDelayTime > 0)
{
thisIDscrollTop -= thisScrollStep + thisStep - thisCTL;
thisPause();
return;
}
else
{
if(thisIDscrollTop <= 0)
{
thisIDscrollTop += thisClientScroll;
}
thisIDscrollTop -= thisStep;
}
break;
case 2:
thisCTL += thisStep;
if(thisCTL >= thisScrollStep && thisDelayTime > 0)
{
thisIDscrollLeft += thisScrollStep + thisStep - thisCTL;
thisPause();
return;
}
else
{
if(thisIDscrollLeft >= thisClientScroll)
{
thisIDscrollLeft -= thisClientScroll;
}
thisIDscrollLeft += thisStep;
}
break;
case 3:
thisCTL += thisStep;
if(thisCTL >= thisScrollStep && thisDelayTime > 0)
{
thisIDscrollLeft -= thisScrollStep + thisStep - thisCTL;
thisPause();
return;
}
else
{
if(thisIDscrollLeft <= 0)
{
thisIDscrollLeft += thisClientScroll;
}
thisIDscrollLeft -= thisStep;
}
break;
}
}
//-->
以上就是关于急求,51单片机走马灯+按键暂停这个用汇编语言编一个程序,图全部的内容,包括:急求,51单片机走马灯+按键暂停这个用汇编语言编一个程序,图、用js 实现走马灯效果,横向的怎么实现纵向的又是怎么实现的、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)