A

롤링배너객체 Rolling

· 17년 전 · 2358
------------------------------------- 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,527
17년 전 조회 1,124
17년 전 조회 1,255
17년 전 조회 3,130
17년 전 조회 2,183
17년 전 조회 1,997
17년 전 조회 1,242
17년 전 조회 2,475
17년 전 조회 1,197
17년 전 조회 1,158
17년 전 조회 1,405
17년 전 조회 2,772
17년 전 조회 2,417
17년 전 조회 2,506
17년 전 조회 1,210
17년 전 조회 1,326
17년 전 조회 3,276
17년 전 조회 2,858
17년 전 조회 4,129
17년 전 조회 2,293
17년 전 조회 2,390
17년 전 조회 1,436
17년 전 조회 2,551
17년 전 조회 2,237
17년 전 조회 3,001
17년 전 조회 2,505
17년 전 조회 1,665
17년 전 조회 2,459
17년 전 조회 1,614
17년 전 조회 1,201
17년 전 조회 2,260
17년 전 조회 2,905
17년 전 조회 4,081
17년 전 조회 3,173
17년 전 조회 1,435
17년 전 조회 1,722
17년 전 조회 2,264
17년 전 조회 1,577
17년 전 조회 1,755
17년 전 조회 2,742
17년 전 조회 2,170
17년 전 조회 1,822
17년 전 조회 4,225
17년 전 조회 3,075
17년 전 조회 1,465
17년 전 조회 3,601
17년 전 조회 2,820
17년 전 조회 2,099
17년 전 조회 1,325
17년 전 조회 2,359
17년 전 조회 2,101
17년 전 조회 2,007
17년 전 조회 1,953
17년 전 조회 1,209
17년 전 조회 1,904
17년 전 조회 2,961
17년 전 조회 1,462
17년 전 조회 1,705
17년 전 조회 1,379
17년 전 조회 1,632
17년 전 조회 1,608
17년 전 조회 1,476
17년 전 조회 2,585
17년 전 조회 2,353
17년 전 조회 2,129
17년 전 조회 1,442
17년 전 조회 2,457
17년 전 조회 4,275
17년 전 조회 2,763
17년 전 조회 1,684
17년 전 조회 1,888
17년 전 조회 3,260
17년 전 조회 2,270
17년 전 조회 3,859
17년 전 조회 1,701
17년 전 조회 2,297
17년 전 조회 2,130
17년 전 조회 1,641
17년 전 조회 2,157
17년 전 조회 1,961
17년 전 조회 1,989
17년 전 조회 3,104
17년 전 조회 2,182
17년 전 조회 1,460
17년 전 조회 1,488
17년 전 조회 2,157
17년 전 조회 3,230
17년 전 조회 2,173
17년 전 조회 1,558
17년 전 조회 4,267
17년 전 조회 2,054
17년 전 조회 3,485
17년 전 조회 6,057
17년 전 조회 1,518
17년 전 조회 1,683
17년 전 조회 1,261
17년 전 조회 1,377
17년 전 조회 2,902
17년 전 조회 1,935
17년 전 조회 2,625