A

롤링배너객체 Rolling

· 17년 전 · 2386
------------------------------------- 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,546
17년 전 조회 1,144
17년 전 조회 1,276
17년 전 조회 3,154
17년 전 조회 2,209
17년 전 조회 2,015
17년 전 조회 1,271
17년 전 조회 2,491
17년 전 조회 1,212
17년 전 조회 1,182
17년 전 조회 1,432
17년 전 조회 2,793
17년 전 조회 2,447
17년 전 조회 2,527
17년 전 조회 1,233
17년 전 조회 1,346
17년 전 조회 3,299
17년 전 조회 2,880
17년 전 조회 4,156
17년 전 조회 2,310
17년 전 조회 2,417
17년 전 조회 1,464
17년 전 조회 2,576
17년 전 조회 2,262
17년 전 조회 3,015
17년 전 조회 2,526
17년 전 조회 1,689
17년 전 조회 2,483
17년 전 조회 1,642
17년 전 조회 1,230
17년 전 조회 2,289
17년 전 조회 2,929
17년 전 조회 4,104
17년 전 조회 3,200
17년 전 조회 1,469
17년 전 조회 1,736
17년 전 조회 2,287
17년 전 조회 1,597
17년 전 조회 1,777
17년 전 조회 2,756
17년 전 조회 2,190
17년 전 조회 1,842
17년 전 조회 4,255
17년 전 조회 3,099
17년 전 조회 1,493
17년 전 조회 3,621
17년 전 조회 2,855
17년 전 조회 2,120
17년 전 조회 1,352
17년 전 조회 2,387
17년 전 조회 2,118
17년 전 조회 2,035
17년 전 조회 1,981
17년 전 조회 1,232
17년 전 조회 1,932
17년 전 조회 2,980
17년 전 조회 1,486
17년 전 조회 1,725
17년 전 조회 1,409
17년 전 조회 1,657
17년 전 조회 1,632
17년 전 조회 1,505
17년 전 조회 2,613
17년 전 조회 2,375
17년 전 조회 2,150
17년 전 조회 1,467
17년 전 조회 2,480
17년 전 조회 4,295
17년 전 조회 2,789
17년 전 조회 1,705
17년 전 조회 1,910
17년 전 조회 3,291
17년 전 조회 2,288
17년 전 조회 3,876
17년 전 조회 1,726
17년 전 조회 2,323
17년 전 조회 2,156
17년 전 조회 1,664
17년 전 조회 2,184
17년 전 조회 1,982
17년 전 조회 2,022
17년 전 조회 3,138
17년 전 조회 2,205
17년 전 조회 1,481
17년 전 조회 1,515
17년 전 조회 2,178
17년 전 조회 3,254
17년 전 조회 2,192
17년 전 조회 1,573
17년 전 조회 4,286
17년 전 조회 2,078
17년 전 조회 3,506
17년 전 조회 6,083
17년 전 조회 1,542
17년 전 조회 1,697
17년 전 조회 1,290
17년 전 조회 1,390
17년 전 조회 2,926
17년 전 조회 1,950
17년 전 조회 2,650