A

롤링배너객체 Rolling

· 17년 전 · 2720
------------------------------------- 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,911
17년 전 조회 1,486
17년 전 조회 1,642
17년 전 조회 3,554
17년 전 조회 2,586
17년 전 조회 2,380
17년 전 조회 1,635
17년 전 조회 2,859
17년 전 조회 1,577
17년 전 조회 1,550
17년 전 조회 1,807
17년 전 조회 3,150
17년 전 조회 2,824
17년 전 조회 2,910
17년 전 조회 1,601
17년 전 조회 1,729
17년 전 조회 3,694
17년 전 조회 3,251
17년 전 조회 4,519
17년 전 조회 2,685
17년 전 조회 2,788
17년 전 조회 1,838
17년 전 조회 2,930
17년 전 조회 2,632
17년 전 조회 3,405
17년 전 조회 2,891
17년 전 조회 2,051
17년 전 조회 2,838
17년 전 조회 1,980
17년 전 조회 1,579
17년 전 조회 2,656
17년 전 조회 3,271
17년 전 조회 4,476
17년 전 조회 3,553
17년 전 조회 1,830
17년 전 조회 2,044
17년 전 조회 2,630
17년 전 조회 1,934
17년 전 조회 2,140
17년 전 조회 3,090
17년 전 조회 2,533
17년 전 조회 2,187
17년 전 조회 4,614
17년 전 조회 3,421
17년 전 조회 1,823
17년 전 조회 3,963
17년 전 조회 3,198
17년 전 조회 2,448
17년 전 조회 1,708
17년 전 조회 2,721
17년 전 조회 2,455
17년 전 조회 2,387
17년 전 조회 2,327
17년 전 조회 1,555
17년 전 조회 2,263
17년 전 조회 3,312
17년 전 조회 1,792
17년 전 조회 2,060
17년 전 조회 1,737
17년 전 조회 1,991
17년 전 조회 1,958
17년 전 조회 1,858
17년 전 조회 2,944
17년 전 조회 2,703
17년 전 조회 2,502
17년 전 조회 1,787
17년 전 조회 2,825
17년 전 조회 4,630
17년 전 조회 3,120
17년 전 조회 2,048
17년 전 조회 2,239
17년 전 조회 3,651
17년 전 조회 2,637
17년 전 조회 4,206
17년 전 조회 2,051
17년 전 조회 2,642
17년 전 조회 2,491
17년 전 조회 2,009
17년 전 조회 2,505
17년 전 조회 2,342
17년 전 조회 2,359
17년 전 조회 3,472
17년 전 조회 2,536
17년 전 조회 1,818
17년 전 조회 1,839
17년 전 조회 2,504
17년 전 조회 3,591
17년 전 조회 2,501
17년 전 조회 1,934
17년 전 조회 4,632
17년 전 조회 2,408
17년 전 조회 3,862
17년 전 조회 6,416
17년 전 조회 1,864
17년 전 조회 2,038
17년 전 조회 1,607
17년 전 조회 1,724
17년 전 조회 3,257
17년 전 조회 2,300
17년 전 조회 2,949