随笔分类 - javascript
摘要:JQuery获取浏览器窗口宽高,文档宽高2010-01-20 08:59js网页可见区域宽: document.body.clientWidth网页可见区域高: document.body.clientHeight网页可见区域宽: document.body.offsetWidth (包括边线的宽)网页可见区域高: document.body.offsetHeight (包括边线的高)网页正文全文宽: document.body.scrollWidth网页正文全文高: document.body.scrollHeight网页被卷去的高: document.body.scrollTop网页被卷去
阅读全文
摘要:function changeDeadline() { var days = parseInt(document.getElementById("<%=hd_days.ClientID %>").value); var datetemp = document.getElementById("<%=tb_cir.ClientID %>").value var CurrentDate = datetemp.replace("-","/"); var tarDate = new Date(Curr
阅读全文
摘要:在ie中使用window.frames["Iframe1"].document.location="";无任何问题,可在谷歌中出现location未定义错误其真正原因还在浏览器的内核不一样,参照:http://blog.csdn.net/lzy_1515/article/details/6045629所以将iframe的id和name设成一样的即可<iframe frameborder="0" id="Iframe1" name="Iframe1" scrolling="yes&
阅读全文
摘要:<SCRIPT LANGUAGE="JavaScript"> <!-- String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.LTrim = function() { return this.replace(/(^\s*)/g, ""); } String.prototype.RTrim = function() { return this.replace(/(\s*$)/g
阅读全文
摘要:this.ClientScript.RegisterStartupScript(this.GetType(), this.Title, "window.opener.location.reload();alert('销帐成功!');", true); 主要是这段js代码:window.opener.location.reload(); 如果没特殊要求,可以考虑用div
阅读全文
摘要:首先,html代码: <div style="display:none;"><iframe id="compareIframe" src=""></iframe></div> js代码: var compareContent=”你要改变的值"; if (compareContent != "") { document.getElement...
阅读全文
摘要:<script type="text/javascript"> function addFav() { // 加入收藏夹 if (document.all) { window.external.addFavorite('http://www.cnblogs.com/wuchao/’, 'wuchaode blo...
阅读全文
摘要:网页可见区域宽: document.body.clientWidth网页可见区域高: document.body.clientHeight网页可见区域宽: document.body.offsetWidth (包括边线的宽)网页可见区域高: document.body.offsetHeight (包括边线的高)网页正文全文宽: document.body.scrollWidth网页正文全文高: document.body.scrollHeight网页被卷去的高: document.body.scrollTop网页被卷去的左: document.body.scrollLeft网页正文部分上: w
阅读全文
摘要:var tip = setInterval("checkTime()", "10000"); var temp = document.getElementById("hidden_endT").value; var datereturn = toDate(temp); function checkTime() { var myTime=Date(); if (Date.parse(myTime) > datereturn) { clearInterval(tip); var auctionCode=document.getEle
阅读全文
摘要:js:var isDrag = 0;var divMove; var divAndMouseX;//鼠标落点距离div左上角x坐标的差距 var divAndMouseY;//鼠标落点距离div左上角y坐标的差距 function down(div) { isDrag = 1; divMove = div; divAndMouseX = event.clientX - parseInt(document.getElementById(div).offsetLeft); divAndMouseY = event.clientY - parseInt(document.getElementById
阅读全文
摘要:javascript:document.getElementById("id").focus();或javascript:document.all.id.focus();或javascript:document.all.name.focus();例子:<input type="text" name="tt" id="tt"> <input type="button" name="bt" id="bt" onclick="java
阅读全文
摘要:<SCRIPT LANGUAGE="javascript"> <!-- window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no') //写成一行 --> </SCRIPT> 参数解释: <SCRIPT LANGUAGE="javas
阅读全文
摘要:<!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> <title>广告</title> <script src="../js/jquery-1.4.4.min.js"
阅读全文
摘要:document.body.innerHTML = 'xxxx'; $("body").html('XXXX'); //这个是赋值$("body").html(); //这个是获取
阅读全文
摘要:jquery.autocomplete参考地址 http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ http://docs.jquery.com/Plugins/Autocompletehttp://www.open-open.com/ajax/ajax20080314223855.htmhttp://www.36ria.com/719例子:<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server&qu
阅读全文
摘要:1.<marquee id="mar1" scrollAmount="2" direction="up" height="100" onmouseout="scollStart()" onmouseover="scollStop()">内容显示</marquee>marquee 参数:BGColor:滚动文本框的背景颜色。Direction:滚动方向设置,可选择Left、Right、up和down。scrolldelay:每轮滚动之间的延迟时间,越大越
阅读全文
摘要:<!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-Type" content="text/html; charset=gb23
阅读全文
摘要:<html><head><script type="text/javascript">function startTime(){var today=new Date()var h=today.getHours()var m=today.getMinutes()var s=today.getSeconds()// add a zero in front of numbers<10m=checkTime(m)s=checkTime(s)document.getElementById('txt').innerHTML=h+
阅读全文
摘要:例如一段代码:<html><head><script type="text/javascript">function displaymessage(){alert("Hello World!")}</script></head><body><form><input type="button" value="Click me!" onclick="displaymessage()" ></form
阅读全文
摘要:实际上,setTimeout和setInterval的语法相同。它们都有两个参数,一个是将要执行的代码字符串,还有一个是以毫秒为单位的时间间隔,当过了那个时间段之后就将执行那段代码。不过这两个函数还是有区别的,setInterval在执行完一次代码之后,经过了那个固定的时间间隔,它还会自动重复执行代码,而setTimeout只执行一次那段代码。虽然表面上看来setTimeout只能应用在on-off方式的动作上,不过可以通过创建一个函数循环重复调用setTimeout,以实现重复的操作使用clearTimeout,clearInterval来停止设置一个无限循环的:<script typ
阅读全文

浙公网安备 33010602011771号