A

롤링배너객체 Rolling

· 17년 전 · 2392
------------------------------------- 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,553
17년 전 조회 1,148
17년 전 조회 1,283
17년 전 조회 3,158
17년 전 조회 2,218
17년 전 조회 2,022
17년 전 조회 1,276
17년 전 조회 2,495
17년 전 조회 1,221
17년 전 조회 1,189
17년 전 조회 1,441
17년 전 조회 2,800
17년 전 조회 2,453
17년 전 조회 2,537
17년 전 조회 1,237
17년 전 조회 1,352
17년 전 조회 3,307
17년 전 조회 2,889
17년 전 조회 4,161
17년 전 조회 2,313
17년 전 조회 2,422
17년 전 조회 1,474
17년 전 조회 2,580
17년 전 조회 2,269
17년 전 조회 3,019
17년 전 조회 2,532
17년 전 조회 1,701
17년 전 조회 2,489
17년 전 조회 1,646
17년 전 조회 1,237
17년 전 조회 2,290
17년 전 조회 2,935
17년 전 조회 4,116
17년 전 조회 3,208
17년 전 조회 1,472
17년 전 조회 1,738
17년 전 조회 2,298
17년 전 조회 1,601
17년 전 조회 1,783
17년 전 조회 2,767
17년 전 조회 2,197
17년 전 조회 1,848
17년 전 조회 4,258
17년 전 조회 3,102
17년 전 조회 1,498
17년 전 조회 3,624
17년 전 조회 2,860
17년 전 조회 2,130
17년 전 조회 1,358
17년 전 조회 2,393
17년 전 조회 2,124
17년 전 조회 2,041
17년 전 조회 1,990
17년 전 조회 1,240
17년 전 조회 1,941
17년 전 조회 2,987
17년 전 조회 1,493
17년 전 조회 1,730
17년 전 조회 1,415
17년 전 조회 1,666
17년 전 조회 1,636
17년 전 조회 1,507
17년 전 조회 2,620
17년 전 조회 2,378
17년 전 조회 2,160
17년 전 조회 1,472
17년 전 조회 2,486
17년 전 조회 4,301
17년 전 조회 2,794
17년 전 조회 1,713
17년 전 조회 1,919
17년 전 조회 3,294
17년 전 조회 2,291
17년 전 조회 3,879
17년 전 조회 1,734
17년 전 조회 2,329
17년 전 조회 2,164
17년 전 조회 1,668
17년 전 조회 2,194
17년 전 조회 1,984
17년 전 조회 2,025
17년 전 조회 3,145
17년 전 조회 2,215
17년 전 조회 1,487
17년 전 조회 1,519
17년 전 조회 2,183
17년 전 조회 3,257
17년 전 조회 2,195
17년 전 조회 1,576
17년 전 조회 4,291
17년 전 조회 2,085
17년 전 조회 3,514
17년 전 조회 6,087
17년 전 조회 1,545
17년 전 조회 1,706
17년 전 조회 1,291
17년 전 조회 1,401
17년 전 조회 2,931
17년 전 조회 1,956
17년 전 조회 2,653