Đăng nhập | Đăng ký

Danh sách thành viên | Cá nhân | Nhà đất, bất động sản

Diễn đàn    Html DOM javascript CSS    Tự động cuộn lên bằng javascript

Thành viênNội dung
dotnetvn

dotnet.vn
72  bài
30-05-2009 03:17:10
Mã cực kỳ đơn giản
--------------

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

<div class="example">
<ul id="lines">
<li>nguyen duc khanh</li>
<li>do van loc</li>
<li>pham hoang giang</li>
<li>nguyen tuan anh</li>
<li>truong van thuan</li>
<li>ngo hai anh</li>
<li>duong thu huong</li>
</ul>
</div>

<script type="text/javascript">
var lines = document.getElementById('lines');

var nodeRotator = new Rotator( lines.getElementsByTagName('li'), function( li, index ){
this.parentNode.insertBefore(li,this); //rotate (visually) the matched dom elements
});
setInterval(function(){nodeRotator.right();},700);
</script>
</body>
</html>
 
dotnetvn

dotnet.vn
72  bài
30-05-2009 03:17:28
/**
* Rotator - Generic class to rotate different kind of collections.
* Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 2/20/2008
* @version 1.0.0
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
*/
;function Rotator( coll, setter, getter ){
this.collection( coll );
switch( typeof setter ){
case 'string': this.setter = function(v){ this [setter] = v; }; break;
case 'undefined': setter = Rotator.defaultSetter;
case 'function': this.setter = setter;
}
switch( typeof getter ){
case 'string': this.getter = function(){ return this [getter] ; }; break;
case 'undefined': getter = Rotator.defaultGetter;
case 'function': this.getter = getter;
}
};

Rotator.toArray = function( obj ){
if( obj.split )
return obj.split('');
var arr = [] , l = obj.length;
while(l--)
arr [l] = obj [l] ;
return arr;
};

Rotator.defaultGetter = function(){
return this;
};
Rotator.defaultSetter = function( value ){
return value;
};

Rotator.prototype = {
constructor:Rotator,
collection:function( c ){
if( c === undefined ) return this._c_;
this._c_ = Rotator.toArray(c);
},
_getValues:function(){
var values = [ ] ;
for( var i=0, l=this._c_.length; i < l; i++ )
values [ i ] = this.getter.call( this._c_ [ i ] , i );
return values;
},
_setValues:function( values ){
for( var i=0, l=values.length; i < l; i++ ){
var ret = this.setter.call( this._c_ [ i ] , values [ i ] , i );
if( ret !== undefined )
this._c_ [ i ] = ret;
}
},
left:function(){
var values = this._getValues();
values.push( values.shift() );
this._setValues( values );
},
right:function(){
var values = this._getValues();
values.unshift( values.pop() );
this._setValues( values );
}
};
 
dotnetvn

dotnet.vn
72  bài
30-05-2009 03:21:58
http://coder.awas.vn/downloads.ashx?id=3cc667eb4d3f4a268fa28f62394a8b1e

link download
---
 
radiogaga

Ta đây thủy tinh, có tài gọi mưa hô gió ... Sơn Tinh ta đây : có tài là đốn gốc cây, đánh hốc cây ...
44  bài
01-06-2009 11:28:33
Cái của pác dotnetvn chỉ cuộn xuống, còn cuộn lên thì chết hẳn, em có đoạn này cả cuộn lên và cuộn xuống đều ngon lành.

------------
<html>
<head>
<title>Roll Up Down Using javascript</title>
<script type="text/javascript" src="rotator.js"></script>
</head>
<body>

<div class="example">
<ul id="lines">
<li>1. nguyen duc khanh</li>
<li>2. do van loc</li>
<li>3. pham hoang giang</li>
<li>4. nguyen tuan anh</li>
<li>5. truong van thuan</li>
<li>6. ngo hai anh</li>
<li>7. duong thu huong</li>
<li>8. nguyen tuan anh</li>
<li>9. truong van thuan</li>
<li>10. ngo hai anh</li>
<li>11. duong thu huong</li>
<li>12. truong van thuan</li>
<li>13. ngo hai anh</li>
<li>14. duong thu huong</li>
</ul>
</div>


<script type="text/javascript">

var lines = document.getElementById('lines');
var lists = lines.getElementsByTagName('li');
setInterval(function(){rollup(lists)},700);

function rollup(lists)
{
for (i = 0; i < lists.length-1; i++)
{
s = lists [ i ] .innerHTML;
lists [ i ] .innerHTML = lists [i+1] .innerHTML
lists [i+1] .innerHTML = s;
}
}

function rolldown(lists)
{
for (i = lists.length-1; i > 0; i--)
{
s = lists [ i ] .innerHTML;
lists [ i ] .innerHTML = lists [i-1] .innerHTML
lists [i-1] .innerHTML = s;
}
}

</script>
</body>
</html>
---
 

Chủ đề gần đây :

Cùng loại :

 
Tên file Người đăng Ngày Lượt
vspforum.zip
Ma nguon vspforum ngay xua
aspnet 4/18/2023 6:38:37 AM 6
pdfjs.rar
pdfjs 2017 : hiển thị tốt trên iphone 11, 12, 13 không lỗi, bản 2012 sẽ lỗi trên iphone
aspnet 6/21/2022 11:52:48 AM 2
pdfjs2.rar
Xem file pdf bằng viewer.hml cua pdfjs (thư viện chuẩn mozilla) 2012. https://mozilla.github.io/pdf.js/getting_started/#download có thể download bản prebuild tại đây
aspnet 6/21/2022 11:52:04 AM 2
runner.zip
using three.js, orbitcontrol to view an object move random on map. Di chuyển 1 đồ vật ngẫu nhiên trên bản đồ, sử dụng với demo nhân viên di chuyển trong văn phòng. Toàn js download về là chạy
aspnet 12/5/2019 5:55:14 PM 0
gmap.zip
google map + marker
aspnet 7/17/2019 2:25:05 PM 1
vinsmarthomeservice.zip
java post json to api, use AsyncTask, event listener
aspnet 7/9/2019 5:00:10 PM 1
fblogin.zip
Login facebook bang javascript SDK
aspnet 7/9/2019 9:16:37 AM 0
autocomplete-location.zip
autocomplete location geo from google place, html + js
aspnet 7/4/2019 4:37:55 PM 2
WebAPI.zip
api for android access db (v1.0.0)
aspnet 7/4/2019 9:14:17 AM 8
KydientuPdf.zip
Ky dien tu file PDF su dung itextsharp
aspnet 4/9/2019 3:30:37 PM 9
GooglePlusLogin.zip
Login Google Plus account, C#, web asp.net ver2.0. Simple connect google APIs. Send key, get token, get full account info
aspnet 6/1/2018 10:41:12 AM 11
WebApplication1.rar
Sample su dung thuat toan ma hoa tripDES, co khoa bi mat (privateKey)
aspnet 3/30/2018 10:06:35 PM 8
NETMdbToolsTestApp.rar
dotNet MdbTools for Access 2003/2007/2016 without Microsoft Jet Engine, source C#, https://www.codeproject.com/Articles/283626/MsAccess-MdbTools-with-MFC-and-NET
aspnet 3/26/2018 11:43:16 PM 1
Cryptography_MD5_TriDES_src.zip
Thuật toán mã hóa 2 chiều TriDES, gồm Encrypt và Decrypt, aspnet 2.0
aspnet 3/22/2018 11:20:44 AM 3
mvc.rar
sample project MVC on C#
aspnet 3/20/2018 9:25:36 AM 9
EduPortal.rar
Edu portal frame work for VB.NET
aspnet 3/14/2018 12:00:41 AM 13
AutoEntity.rar
Gencode vb.net visual studio 2015. dotnet v2.0
aspnet 3/13/2018 11:59:16 PM 2
GenCode.rar
Gencode XML, XSLT, Info, DAL .. engine enterprise for quick app database
aspnet 2/5/2018 9:37:28 AM 9
DataXml.rar
Read DB from SQL to XML file, Convert string TCVN to Unicode
aspnet 1/29/2018 2:15:45 PM 4
DesktopModules.rar
Module quản lý tin tức, CMS, quản lý nhóm tin trên dotnetnuke 6.x
aspnet 3/7/2013 4:47:49 PM 1714
CODERVN.NET
Công ty cổ phần công nghệ và dịch vụ AWAS
Công ty cổ phần công nghệ và dịch vụ AWAS, cổng thông tin, chính phủ điện tử, phần mềm quản lý điểm, quản lý sinh viên, http://awas.vn, http://awas.com.vn, phần mềm ứng dụng, dịch vụ công trực tuyến, thiết kế website, thiet ke web, thiết kế web, điện lực, phần mềm quản lý đào tạo, cao đẳng, đại học,cổng thông tin tích hợp, cổng thông tin điện tử, webportal, thư viện điện tử, electric library, library online, email, web, quản lý quan hệ khách hàng, CRM, dịch vụ công trực tuyến, phần mềm hành chính một cửa,