1. 程式人生 > >JavaScript 經典效果集

JavaScript 經典效果集

八 很多的指令碼翻頁
<textarea rows="12" cols="95" name="runcode6">&lt;!doctype html public &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; &lt;head&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt; &lt;title&gt; JavaScript: showPages v1.0 [by Lapuasi.com]&lt;/title&gt; &lt;script language=&quot;JavaScript&quot;&gt; &lt;!-- /* showPages v1.1 ================================= Infomation ---------------------- Author : Lapuasi E-Mail :
[email protected]
Web : http://www.lapuasi.com Date : 2005-11-17 Example ---------------------- var pg = new showPages('pg'); pg.pageCount = 12; //定義總頁數(必要) pg.argName = 'p'; //定義引數名(可選,預設為page) pg.printHtml(); //顯示頁數 Supported in Internet Explorer, Mozilla Firefox */ function showPages(name) { //初始化屬性 this.name = name; //物件名稱 this.page = 1; //當前頁數 this.pageCount = 1; //總頁數 this.argName = 'page'; //引數名 this.showTimes = 1; //列印次數 } showPages.prototype.getPage = function(){ //叢url獲得當前頁數,如果變數重複只獲取最後一個 var args = location.search; var reg = new RegExp('[\?&amp;]?' + this.argName + '=([^&amp;]*)[&amp;$]?', 'gi'); var chk = args.match(reg); this.page = RegExp.$1; } showPages.prototype.checkPages = function(){ //進行當前頁數和總頁數的驗證 if (isNaN(parseInt(this.page))) this.page = 1; if (isNaN(parseInt(this.pageCount))) this.pageCount = 1; if (this.page &lt; 1) this.page = 1; if (this.pageCount &lt; 1) this.pageCount = 1; if (this.page &gt; this.pageCount) this.page = this.pageCount; this.page = parseInt(this.page); this.pageCount = parseInt(this.pageCount); } showPages.prototype.createHtml = function(mode){ //生成html程式碼 var strHtml = '', prevPage = this.page - 1, nextPage = this.page + 1; if (mode == '' || typeof(mode) == 'undefined') mode = 0; switch (mode) { case 0 : //模式1 (頁數,首頁,前頁,後頁,尾頁) strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;'; strHtml += '&lt;span class=&quot;number&quot;&gt;'; if (prevPage &lt; 1) { strHtml += '&lt;span title=&quot;First Page&quot;&gt;«&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;‹&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;«&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;‹&lt;/a&gt;&lt;/span&gt;'; } for (var i = 1; i &lt;= this.pageCount; i++) { if (i &gt; 0) { if (i == this.page) { strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;[' + i + ']&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + i + ');&quot;&gt;[' + i + ']&lt;/a&gt;&lt;/span&gt;'; } } } if (nextPage &gt; this.pageCount) { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;›&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;»&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;›&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;»&lt;/a&gt;&lt;/span&gt;'; } strHtml += '&lt;/span&gt;&lt;br /&gt;'; break; case 1 : //模式1 (10頁縮略,首頁,前頁,後頁,尾頁) strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;'; strHtml += '&lt;span class=&quot;number&quot;&gt;'; if (prevPage &lt; 1) { strHtml += '&lt;span title=&quot;First Page&quot;&gt;«&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;‹&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;«&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;‹&lt;/a&gt;&lt;/span&gt;'; } if (this.page % 10 ==0) { var startPage = this.page - 9; } else { var startPage = this.page - this.page % 10 + 1; } if (startPage &gt; 10) strHtml += '&lt;span title=&quot;Prev 10 Pages&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + (startPage - 1) + ');&quot;&gt;...&lt;/a&gt;&lt;/span&gt;'; for (var i = startPage; i &lt; startPage + 10; i++) { if (i &gt; this.pageCount) break; if (i == this.page) { strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;[' + i + ']&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + i + ');&quot;&gt;[' + i + ']&lt;/a&gt;&lt;/span&gt;'; } } if (this.pageCount &gt;= startPage + 10) strHtml += '&lt;span title=&quot;Next 10 Pages&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + (startPage + 10) + ');&quot;&gt;...&lt;/a&gt;&lt;/span&gt;'; if (nextPage &gt; this.pageCount) { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;›&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;»&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;›&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;»&lt;/a&gt;&lt;/span&gt;'; } strHtml += '&lt;/span&gt;&lt;br /&gt;'; break; case 2 : //模式2 (前後縮略,頁數,首頁,前頁,後頁,尾頁) strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;'; strHtml += '&lt;span class=&quot;number&quot;&gt;'; if (prevPage &lt; 1) { strHtml += '&lt;span title=&quot;First Page&quot;&gt;«&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;‹&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;«&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;‹&lt;/a&gt;&lt;/span&gt;'; } if (this.page != 1) strHtml += '&lt;span title=&quot;Page 1&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;[1]&lt;/a&gt;&lt;/span&gt;'; if (this.page &gt;= 5) strHtml += '&lt;span&gt;...&lt;/span&gt;'; if (this.pageCount &gt; this.page + 2) { var endPage = this.page + 2; } else { var endPage = this.pageCount; } for (var i = this.page - 2; i &lt;= endPage; i++) { if (i &gt; 0) { if (i == this.page) { strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;[' + i + ']&lt;/span&gt;'; } else { if (i != 1 &amp;&amp; i != this.pageCount) { strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + i + ');&quot;&gt;[' + i + ']&lt;/a&gt;&lt;/span&gt;'; } } } } if (this.page + 3 &lt; this.pageCount) strHtml += '&lt;span&gt;...&lt;/span&gt;'; if (this.page != this.pageCount) strHtml += '&lt;span title=&quot;Page ' + this.pageCount + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;[' + this.pageCount + ']&lt;/a&gt;&lt;/span&gt;'; if (nextPage &gt; this.pageCount) { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;›&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;»&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;›&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;»&lt;/a&gt;&lt;/span&gt;'; } strHtml += '&lt;/span&gt;&lt;br /&gt;'; break; case 3 : //模式3 (箭頭樣式,首頁,前頁,後頁,尾頁) (only IE) strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;'; strHtml += '&lt;span class=&quot;arrow&quot;&gt;'; if (prevPage &lt; 1) { strHtml += '&lt;span title=&quot;First Page&quot;&gt;9&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;7&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;9&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;7&lt;/a&gt;&lt;/span&gt;'; } if (nextPage &gt; this.pageCount) { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;8&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;:&lt;/span&gt;'; } else { strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;8&lt;/a&gt;&lt;/span&gt;'; strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;:&lt;/a&gt;&lt;/span&gt;'; } strHtml += '&lt;/span&gt;&lt;br /&gt;'; break; case 4 : //模式4 (下拉框) if (this.pageCount &lt; 1) { strHtml += '&lt;select name=&quot;toPage&quot; disabled&gt;'; strHtml += '&lt;option value=&quot;0&quot;&gt;No Pages&lt;/option&gt;'; } else { var chkSelect; strHtml += '&lt;select name=&quot;toPage&quot; onchange=&quot;' + this.name + '.toPage(this);&quot;&gt;'; for (var i = 1; i &lt;= this.pageCount; i++) { if (this.page == i) chkSelect=' selected=&quot;selected&quot;'; else chkSelect=''; strHtml += '&lt;option value=&quot;' + i + '&quot;' + chkSelect + '&gt;Pages: ' + i + ' / ' + this.pageCount + '&lt;/option&gt;'; } } strHtml += '&lt;/select&gt;'; break; case 5 : //模式5 (輸入框) strHtml += '&lt;span class=&quot;input&quot;&gt;'; if (this.pageCount &lt; 1) { strHtml += '&lt;input type=&quot;text&quot; name=&quot;toPage&quot; value=&quot;No Pages&quot; class=&quot;itext&quot; disabled=&quot;disabled&quot;&gt;'; strHtml += '&lt;input type=&quot;button&quot; name=&quot;go&quot; value=&quot;GO&quot; class=&quot;ibutton&quot; disabled=&quot;disabled&quot;&gt;&lt;/option&gt;'; } else { strHtml += '&lt;input type=&quot;text&quot; value=&quot;Input Page:&quot; class=&quot;ititle&quot; readonly=&quot;readonly&quot;&gt;'; strHtml += '&lt;input type=&quot;text&quot; id=&quot;pageInput' + this.showTimes + '&quot; value=&quot;' + this.page + '&quot; class=&quot;itext&quot; title=&quot;Input page&quot; onkeypress=&quot;return ' + this.name + '.formatInputPage(event);&quot; onfocus=&quot;this.select()&quot;&gt;'; strHtml += '&lt;input type=&quot;text&quot; value=&quot; / ' + this.pageCount + '&quot; class=&quot;icount&quot; readonly=&quot;readonly&quot;&gt;'; strHtml += '&lt;input type=&quot;button&quot; name=&quot;go&quot; value=&quot;GO&quot; class=&quot;ibutton&quot; onclick=&quot;' + this.name + '.toPage(document.getElementById(\'pageInput' + this.showTimes + '\').value);&quot;&gt;&lt;/option&gt;'; } strHtml += '&lt;/span&gt;'; break; default : strHtml = 'Javascript showPage Error: not find mode ' + mode; break; } return strHtml; } showPages.prototype.createUrl = function (page) { //生成頁面跳轉url if (isNaN(parseInt(page))) page = 1; if (page &lt; 1) page = 1; if (page &gt; this.pageCount) page = this.pageCount; var url = location.protocol + '//' + location.host + location.pathname; var args = location.search; var reg = new RegExp('([\?&amp;]?)' + this.argName + '=[^&amp;]*[&amp;$]?', 'gi'); args = args.replace(reg,'$1'); if (args == '' || args == null) { args += '?' + this.argName + '=' + page; } else if (args.substr(args.length - 1,1) == '?' || args.substr(args.length - 1,1) == '&amp;') { args += this.argName + '=' + page; } else { args += '&amp;' + this.argName + '=' + page; } return url + args; } showPages.prototype.toPage = function(page){ //頁面跳轉 var turnTo = 1; if (typeof(page) == 'object') { turnTo = page.options[page.selectedIndex].value; } else { turnTo = page; } self.location.href = this.createUrl(turnTo); } showPages.prototype.printHtml = function(mode){ //顯示html程式碼 this.getPage(); this.checkPages(); this.showTimes += 1; document.write('&lt;div id=&quot;pages_' + this.name + '_' + this.showTimes + '&quot; class=&quot;pages&quot;&gt;&lt;/div&gt;'); document.getElementById('pages_' + this.name + '_' + this.showTimes).innerHTML = this.createHtml(mode); } showPages.prototype.formatInputPage = function(e){ //限定輸入頁數格式 var ie = navigator.appName==&quot;Microsoft Internet Explorer&quot;?true:false; if(!ie) var key = e.which; else var key = event.keyCode; if (key == 8 || key == 46 || (key &gt;= 48 &amp;&amp; key &lt;= 57)) return true; return false; } //--&gt; &lt;/script&gt; &lt;style&gt; /* Pages Main Tyle */ .pages { color: #000000; cursor: default; font-size: 10px; font-family: Tahoma, Verdana; padding: 3px 0px 3px 0px; } .pages .count, .pages .number, .pages .arrow { color: #000000; font-size: 10px; background-color: #F7F7F7; border: 1px solid #CCCCCC; } /* Page and PageCount Style */ .pages .count { font-weight: bold; border-right: none; padding: 2px 10px 1px 10px; } /* Mode 0,1,2 Style (Number) */ .pages .number { font-weight: normal; padding: 2px 10px 1px 10px; } .pages .number a, .pages .number span { font-size: 10px; } .pages .number span { color: #999999; margin: 0px 3px 0px 3px; } .pages .number a { color: #000000; text-decoration: none; } .pages .number a:hover { color: #0000ff; } /* Mode 3 Style (Arrow) */ .pages .arrow { font-weight: normal; padding: 0px 5px 0px 5px; } .pages .arrow a, .pages .arrow span { font-size: 10px; font-family: Webdings; } .pages .arrow span { color: #999999; margin: 0px 5px 0px 5px; } .pages .arrow a { color: #000000; text-decoration: none; } .pages .arrow a:hover { color: #0000ff; } /* Mode 4 Style (Select) */ .pages select, .pages input { color: #000000; font-size: 10px; font-family: Tahoma, Verdana; } /* Mode 5 Style (Input) */ .pages .input input.ititle, .pages .input input.itext, .pages .input input.icount { color: #666666; font-weight: bold; background-color: #F7F7F7; border: 1px solid #CCCCCC; } .pages .input input.ititle { width: 70px; text-align: right; border-right: none; } .pages .input input.itext { width: 25px; color: #000000; text-align: right; border-left: none; border-right: none; } .pages .input input.icount { width: 35px; text-align: left; border-left: none; } .pages .input input.ibutton { height: 17px; color: #FFFFFF; font-weight: bold; font-family: Verdana; background-color: #999999; border: 1px solid #666666; padding: 0px 0px 2px 1px; margin-left: 2px; cursor: hand; } /* body */ body { font-size: 12px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;script language=&quot;JavaScript&quot;&gt; &lt;!-- var pg = new showPages('pg'); pg.pageCount =12; // 定義總頁數(必要) //pg.argName = 'p'; // 定義引數名(可選,預設為page) document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood Default'); pg.printHtml(); document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 0'); pg.printHtml(0); document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 1'); pg.printHtml(1); document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 2'); pg.printHtml(2); document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 3 (only IE)'); pg.printHtml(3); document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 4'); pg.printHtml(4); document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 5'); pg.printHtml(5); //--&gt; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</textarea>
提示:您可以先修改部分程式碼再執行

相關推薦

JavaScript 經典效果

八 很多的指令碼翻頁 <textarea rows="12" cols="95" name="runcode6">&lt;!doctype html public &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &

經典JavaScript 【合

經典JavaScript 【合集】 1.根據國際標準時間 轉換為中國標準日期時間格式【格林威治時間轉中國常用時間格式】 dataTime = new Date() //Thu Nov 22 2018 14:42:10 GMT+0800 (中國標準時間) d

javascript--經典例項錦

一,javascript動態顯示: 如顯示效果上圖所示: 如圖顯示滑鼠放在百度谷歌等字樣上市動態顯示其內容明細:程式碼如下: <head><title></title><script type="te

JavaScript 經典筆記

實現 2個 write 變量 global light 不能 java 文件夾 JavaScript 是弱類型的語言,所以編譯器不能檢測出類型錯誤。 JavaScript 依賴於全局變量來進行鏈接。所有編譯單元的所有頂級變量被撮合到一個被稱為全局對象(the global

JavaScript 經典之一 閉包

如果 空字符串 domo 然而 logs bsp 學習 相同 com 作為一個前端開發者,閉包是必須要攻克掉的障礙。據說好多面試者掛在閉包面試上。下面我就給大家講一下我理解中的閉包。不說太多的廢話,直接進入主題。 變量作用域 學習編程語言需要明白,變量的作用域。變量作用域分

javascript各種方法

result ret name image 本地預覽 guid return har onchange js圖片轉Base64格式 <!DOCTYPE html> <html> <head> <meta

JavaScript電子書合,你不領一份兒嗎

scrip mage 合集 理解 png 都是 .com body 高清 學習編程不能只看視頻。 看技術博客,看文檔,看相關編程書籍,都是必不可少的學習環節,也是加深對語言理解的一種有效方法。 這裏,略小坑給大家整理了36本JavaScript經典書籍的電子版,除了幾本是掃

前端javaScript經典面試題

new 可能 spa 設置 沒有 sco test 問題 輸出結果 1.alert(1&&2),alert(1||0) alert(1&&2)的結果是2 只要“&&”前面是false,無論“&&”後

JavaScript手風琴效果

ren pad city 圖片 tostring borde pan min back <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8">

JavaScript經典面試題詳解

局部對象 hello 結果 檢查 fun type 功能 初始化 als 以下是我遇到的一些經典的JS面試題,結合我自己的理解寫的詳解,主要參考高程一書,歡迎大家批評指正 1. var a; console.log(a);

JavaScript實用效果整理》系列分享專欄

創建 query ctrl+ form share jquery ctrl 電子商務網 detail 整理一些使用的JavaScript效果,在Web開發中遇到的比較好的動態效果,都收藏在這裏,對以後的網站開發增加不少的色彩 《JavaScript實用效果整理》已整理成PD

javascript經典閉包問題

//閉包 function fun(n,o) { console.log(o) return { fun:function(m){ return fun(m,n); } }; } var a = fun(0); a.fun(1); a.fun(2

《TensorFlow:實戰Google深度學習框架》——6.1 影象識別中經典資料介紹

1、CIFAR資料集 CIFAR是一個影響力很大的影象分類資料集,CIFAR資料集中的圖片為32*32的彩色圖片,由Alex  Krizhevsky教授、Vinod Nair博士和Geoffrey Hinton教授整理的。 CIFAR是影象詞典專案(Visual Dictionar

javascript經典面試題

1、作用域 (function() { var a = b = 5; })(); console.log(b); //5 複製程式碼 這個問題的陷阱就是,在立即執行函式表示式(IIFE)中,有兩個賦值,但是其中變數a使用關鍵詞var來宣告。這就意味著a是這個函式的區域性變數。與此相反,b被分配給

你知道JS的“三座大山”嗎?帶你初識前端JavaScript經典內容

作用域及閉包 講到作用域,你會想到什麼?當然是執行上下文。每個函式都有自己的 excution context,和 variable object。這些環境用於儲存上下文中的變數,函式宣告,引數等。 this 本質上來說,在 js 裡 this 是一個指向函式執行環境的指標。this 永

JavaScript經典進階:實現拼圖遊戲

(function() { var hideElement = document.getElementsByClassName('hide')[0]; hideElement.addEventListener('click', function

【181102】VC++ DrawCli氏量繪圖,填充、直線等效果原始碼

DrawCli原始碼,綜合了氏量繪圖、畫圓形、橢圓形、三角形等多種規則的圖形,可填充圖案、繪製直線、曲線、設定圖形組合順序等各種畫圖功能,確實是不錯的繪圖例子。 原始碼下載地址:點選下載 備用下載地

javascript面試題

變數沒有宣告就使用,js報錯,如果是物件的屬性沒有宣告就是使用,則返回undefined 基本資料型別:Number,string,boolean,null,undefined,引用型別:Object,Function typeof返回6中資料型別:number, string, boolean,unde

【Android效果】彈幕效果

之前在網上有看到過iOS的彈幕效果實現,搜了一下發現Android實現彈幕效果的帖子比較少,而且寫得都不是很好理解,於是嘗試自己做了一下,寫成這篇部落格,分享出來。 最終效果展示: 實現思路: 1.自定義一個彈幕View,繼承自TextView

5個JavaScript經典面試題

1:Scope作用範圍 複製程式碼程式碼如下:  (function() {     var a = b = 5;  })();  console.log(b); 什麼會被列印在控制檯上? 回答 上面的程式碼會列印 5。 這個問題的訣竅是,這裡有兩個變數宣告,但 a 使用關鍵字var宣告