A

롤링배너객체 Rolling

· 17년 전 · 2562
------------------------------------- Config -------------------------------------
var myRolling = new Rolling(appendElement,width,height,방향[0-좌,1-우,2-상,3-하],스크롤픽셀,호출주기,딜레이);
myRolling.box.innerHTML = "";
myRolling.box.innerHTML += "<div style='width:80px; height:20px; background:#FEA700;'>1</div>";
myRolling.box.innerHTML += "<div style='width:80px; height:20px; background:#FEDD00;'>2</div>";
myRolling.box.innerHTML += "<div style='width:80px; height:20px; background:#FEF500;'>3</div>";
myRolling.box.innerHTML += "<div style='width:80px; height:20px; background:#D7FE00;'>4</div>";
myRolling.Init();    //객체초기화
myRolling.Run();    //객체실행
------------------------------------- Config -------------------------------------


<html>
<head>
<title></title>
<script type="text/javascript" src="Rolling.js"></script>
</head>
<body>

<div id="test1" style="border: 1px solid #000000; width: 800px; height: 150px;"></div>
<br><br>
<div id="test2" style="border: 1px solid #000000; width: 800px; height: 150px;"></div>
<br><br>
<div id="test3" style="border: 1px solid #000000; width: 800px; height: 150px;"><br><br><br></div>
<br><br>
<div id="test4" style="border: 1px solid #000000; width: 800px; height: 150px;"></div>

<script type="text/javascript">
var myRolling1 = new Rolling(document.getElementById("test1"),700,26,2,2,30,3000);
myRolling1.box.innerHTML = "";
myRolling1.box.innerHTML += "<div><nobr><img src='http://www.phpschool.com/menu_images/top_menu1_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu2_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu3_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu4_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu5_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu6_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu7_off.gif'><img src='http://www.phpschool.com/menu_images/top_menu8_off.gif'></nobr></div>";
myRolling1.box.innerHTML += "<div><nobr><img src='http://www.phpschool.com/menu_images/top_menu1_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu2_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu3_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu4_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu5_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu6_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu7_on.gif'><img src='http://www.phpschool.com/menu_images/top_menu8_on.gif'></nobr></div>";
myRolling1.Init();
myRolling1.Run();

var myRolling2 = new Rolling(document.getElementById("test2"),240,50,0,2,10,1000);
myRolling2.box.style.border = "1px solid orange";
myRolling2.box.innerHTML = "";
myRolling2.box.innerHTML += "<div style='width:80px; height:20px; background:#FEA700;'>1</div>";
myRolling2.box.innerHTML += "<div style='width:80px; height:20px; background:#FEDD00;'>2</div>";
myRolling2.box.innerHTML += "<div style='width:80px; height:20px; background:#FEF500;'>3</div>";
myRolling2.box.innerHTML += "<div style='width:80px; height:20px; background:#D7FE00;'>4</div>";
myRolling2.Init();
myRolling2.Run();

var myRolling3 = new Rolling(document.getElementById("test3"),700,30,1,2,1,100);
myRolling3.box.style.border = "1px solid green";
myRolling3.box.innerHTML = "";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#FEA700;'>1</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#FEDD00;'>2</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#FEF500;'>3</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#D7FE00;'>4</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#B9FE00;'>5</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#83FE00;'>6</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#30FE00;'>7</div>";
myRolling3.box.innerHTML += "<div style='width:80px; height:20px; background:#38EF0D;'>8</div>";
myRolling3.Init();
myRolling3.Run();

var myRolling4 = new Rolling(document.getElementById("test4"),400,140,3,2,40,1000);
myRolling4.box.style.border = "1px solid red";
myRolling4.box.innerHTML = "";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#FEA700;'>1</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#FEDD00;'>2</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#FEF500;'>3</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#D7FE00;'>4</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#B9FE00;'>5</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#83FE00;'>6</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#30FE00;'>7</div>";
myRolling4.box.innerHTML += "<div style='width:300px; height:20px; background:#38EF0D;'>8</div>";
myRolling4.Init();
myRolling4.Run();
</script>

</body>
</html>
[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]

첨부파일

Rolling.js (5.6 KB) 150회 2008-09-18 17:55
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
17년 전 조회 1,757
17년 전 조회 1,345
17년 전 조회 1,499
17년 전 조회 3,394
17년 전 조회 2,427
17년 전 조회 2,217
17년 전 조회 1,478
17년 전 조회 2,702
17년 전 조회 1,430
17년 전 조회 1,394
17년 전 조회 1,646
17년 전 조회 3,010
17년 전 조회 2,666
17년 전 조회 2,721
17년 전 조회 1,448
17년 전 조회 1,563
17년 전 조회 3,519
17년 전 조회 3,092
17년 전 조회 4,356
17년 전 조회 2,531
17년 전 조회 2,619
17년 전 조회 1,673
17년 전 조회 2,787
17년 전 조회 2,467
17년 전 조회 3,242
17년 전 조회 2,737
17년 전 조회 1,887
17년 전 조회 2,674
17년 전 조회 1,823
17년 전 조회 1,415
17년 전 조회 2,482
17년 전 조회 3,117
17년 전 조회 4,320
17년 전 조회 3,391
17년 전 조회 1,655
17년 전 조회 1,886
17년 전 조회 2,484
17년 전 조회 1,795
17년 전 조회 1,970
17년 전 조회 2,937
17년 전 조회 2,391
17년 전 조회 2,023
17년 전 조회 4,435
17년 전 조회 3,279
17년 전 조회 1,668
17년 전 조회 3,797
17년 전 조회 3,034
17년 전 조회 2,297
17년 전 조회 1,534
17년 전 조회 2,563
17년 전 조회 2,303
17년 전 조회 2,212
17년 전 조회 2,157
17년 전 조회 1,405
17년 전 조회 2,112
17년 전 조회 3,137
17년 전 조회 1,661
17년 전 조회 1,907
17년 전 조회 1,574
17년 전 조회 1,820
17년 전 조회 1,795
17년 전 조회 1,704
17년 전 조회 2,780
17년 전 조회 2,562
17년 전 조회 2,350
17년 전 조회 1,640
17년 전 조회 2,652
17년 전 조회 4,482
17년 전 조회 2,976
17년 전 조회 1,881
17년 전 조회 2,077
17년 전 조회 3,480
17년 전 조회 2,460
17년 전 조회 4,042
17년 전 조회 1,898
17년 전 조회 2,507
17년 전 조회 2,344
17년 전 조회 1,844
17년 전 조회 2,361
17년 전 조회 2,161
17년 전 조회 2,194
17년 전 조회 3,320
17년 전 조회 2,383
17년 전 조회 1,664
17년 전 조회 1,684
17년 전 조회 2,347
17년 전 조회 3,432
17년 전 조회 2,365
17년 전 조회 1,770
17년 전 조회 4,458
17년 전 조회 2,259
17년 전 조회 3,688
17년 전 조회 6,264
17년 전 조회 1,715
17년 전 조회 1,863
17년 전 조회 1,453
17년 전 조회 1,553
17년 전 조회 3,109
17년 전 조회 2,127
17년 전 조회 2,819