
JavaScript CSS創(chuàng)建右擊菜單效果代碼
效果圖: css和javascript創(chuàng)建頁面右鍵菜單 body { font-family: "宋體"; font-size: 12px; } .skin0 { padding-top: 4px; text-align: left; width: 100px; border: 2px solid black; background-color: menu; fo...
|
效果圖: css和javascript創(chuàng)建頁面右鍵菜單 body { font-family: "宋體"; font-size: 12px; } .skin0 { padding-top: 4px; text-align: left; width: 100px; border: 2px solid black; background-color: menu; fo...
有如下實(shí)現(xiàn)方法: 在Firefox, Google Chrome, Safari, Opera中:可以用 window.getSelection() (參考MDC) 在IE下,可以用 document.selection.createRange().text (參考MSDN)
注:將兩者放在一起的代碼: 復(fù)制代碼 代碼如下:func...
1. Javascript 語法著色
2. 在eclipse中調(diào)試javascript
3. 查看javascript表達(dá)式
4. 語法錯(cuò)誤定位
5. 解決通過超鏈接等方式打開的html頁面不能使用的問題
6. 解決上個(gè)版本中的bug...
今天在網(wǎng)上看到了一份很不錯(cuò)的JavaScript FAQ,由于擔(dān)心自己并不能一直把它讀完,所以就嘗試翻譯一些內(nèi)容,和朋友們一起分享。 FAQ原地址:http://www.javascripter.net/faq/index.htm
一、常見問題...
<% For each obj in Request.Form response.write "<font color=red>"&obj&"</font><br>" obj=Request.Form(obj) response.write obj&"<br>" Next %> <form name=form action="1.asp"...
9. JavaScript的注釋(Comments in JavaScript) Q:我如何在JavaScript代碼中插入注釋? A:JavaScript支持三種不同類型的注釋: 多行C樣式的注釋。 包括在/* 和 */ 內(nèi)的內(nèi)容都是注釋,例如: /* This is a comment */ /* C-style c...
4. JavaScript的局限性(JavaScript Lminitations)Q:JavaScript程序不能做什么?A:JavaScript代碼不能做下列事情:不能使用用戶系統(tǒng)上或者客戶端局域網(wǎng)中的打印機(jī)或者其他設(shè)備。 (解決方法,見打印JavaScript輸出。)不能直接訪問...
前臺 復(fù)制代碼 代碼如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <ti...
前臺 復(fù)制代碼 代碼如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <ti...
R #board tr td{ width: 20px; height: 20px; } Score: 0...
前臺 復(fù)制代碼 代碼如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <ti...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content...
同樣一段代碼,兩次調(diào)用,一次通過,一次異常: function clearSelect(obj){ if(obj && obj.options) obj.options.length=0; } 以下是前人的一些經(jīng)驗(yàn): 這是兩個(gè)經(jīng)典異常,不知道原理的話很難定位。從下面的代碼中可用看到發(fā)生的...
面以三個(gè)頁面分別命名為framedemo.html,top.html,button.html為例來具體說明如何做。 其中framedemo.html由上下兩個(gè)頁面組成,代碼如下: 復(fù)制代碼 代碼如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional/...
JS: 復(fù)制代碼 代碼如下:/* @parem object the tbody's object @parem object tr's object (must be null) @parem string the className of onmousedown @parem string the className of onmouseout */ function order...
(一).確認(rèn)刪除用法: 1. BtnDel.Attributes.Add("onclick","return confirm('"+"確認(rèn)刪除?"+"')"); 2. linktempDelete.Attributes["onclick"]="javascript:return confirm('"+"確認(rèn)刪除?"+"'...
<a href="#" id="a3" onclick="test()" style="display:none"></a> <input type="button" value="clck" onclick="test2('a3');"/> <script language="javascrip...
在習(xí)作的過程中嘗試著貪吃蛇游戲用JS實(shí)現(xiàn)了。竟然成功了。 思路:使用10px*10px的div層擔(dān)當(dāng)“像素”,然后使用40*40矩陣160個(gè)“像素”構(gòu)成了游戲的界面。 下面是代碼: 復(fù)制代碼 代碼如下:// JavaScript Document alert("...
后來發(fā)現(xiàn),如果div樣式,如果設(shè)置了具體的高度,無論ie還ff,都能正常的表現(xiàn)。
但這個(gè)高度并不是固定的,而是會隨著旁邊div內(nèi)容的多少而變化。最后,只好借助javascript,加載時(shí)捕獲有關(guān)的div的高度,將其賦值給指定的div樣式,終于...
[Ctrl+A 全選 注:如需引入外部Js需刷新才能執(zhí)行]...
在IE7/ Firefox 3.0/ Google Chrome通過測試 CloseDemo.htm 復(fù)制代碼 代碼如下:<script> var browserName=navigator.appName; if (browserName=="Netscape") { function closeme() { window.open('','_parent','');...
例子如下: 復(fù)制代碼 代碼如下:<script> /** *動物 */ function Animal(){ this.name='Amimal'; this.showName=function(){ alert(this.name); }; } /* *貓 */ function Cat(){ this.name='cat'; } var animal=new An...
改facebook的,絕對是你想要的,不需要圖片,因?yàn)槲业囊郧皫讉€(gè)東西被轉(zhuǎn)載到好多地方但是沒有人給我說,還沒有人說是哪里來的,就把我blog地址寫這里的,要用的話就把那東西去掉吧 復(fù)制代碼 代碼如下:<!DOCTYPE html PUBLIC "-//W...
1.創(chuàng)建鏈接 復(fù)制代碼 代碼如下:<script language="javascript"> var o = document.body; //創(chuàng)建鏈接 function createA(url,text) { var a = document.createElement("a"); a.href = url; a.innerHTML = text; a.styl...
1、功能講解: innerHTML 設(shè)置或獲取位于對象起始和結(jié)束標(biāo)簽內(nèi)的 HTML outerHTML 設(shè)置或獲取對象及其內(nèi)容的 HTML 形式 innerText 設(shè)置或獲取位于對象起始和結(jié)束標(biāo)簽內(nèi)的文本 outerText 設(shè)置(包括標(biāo)簽)或獲取(不包括標(biāo)...