晨风

-------------------- 业精于勤,荒于嬉;行成于思,毁于随

导航

2013年1月24日

摘要: var js = "alert('B:' + this.id); return false;";// creates a function from the "js" stringvar newclick = eval("(function(){"+js+"});");// clears onclick then sets click$("#anchor").attr('onclick', '').click(newclick);来源:changi 阅读全文

posted @ 2013-01-24 15:20 shenyixin 阅读(1030) 评论(0) 推荐(0) 编辑

2013年1月21日

摘要: 我们根据不同的单击焦点在同一个iframe中打开不同的网页时,往往都需要去动态的改变iframe的大小。我们都知道去改变它的height,但是往往得不到想要的效果。先说说几种实现的方法:首先,触发转到子页面的函数,这个我们需要改变iframe的src的值,可以写在click事件或者mouseover事件或者mousedown事件等等中。var iframe1 = window.parent.document.getElementById("iframeID");iframe1.src="要转到的子页面";接下在就是在改变子页面的大小。这里分为两种(我知道 阅读全文

posted @ 2013-01-21 15:03 shenyixin 阅读(10550) 评论(0) 推荐(0) 编辑

2013年1月18日

摘要: 对于自适应高度的代码有很多,可效率什么的考虑进来好代码就不多见了,不过思路倒是差不多的不带边框的iframe因为能和网页无缝的结合从而不刷新页面的情况下更新页面的部分数据成为可能,可是 iframe的大小却不像层那样可以“伸缩自如”,所以带来了使用上的麻烦,给iframe设置高度的时候多了也不好,少了更是不行,现在,让我来告诉大 家一种iframe动态调整高度的方法,主要是以下JS函数: 第一种方法:代码简单,兼容性还可以,大家可以先测试下。function SetWinHeight(obj) { var win=obj; if (document.getElementById) { if ( 阅读全文

posted @ 2013-01-18 10:31 shenyixin 阅读(400) 评论(0) 推荐(0) 编辑

2013年1月17日

摘要: <SCRIPT LANGUAGE="JavaScript"> function bb(va) { if(va==13) { alert("回车了") } } </SCRIPT><BODY onkeydown="bb(event.keyCode)"> 阅读全文

posted @ 2013-01-17 18:16 shenyixin 阅读(206) 评论(0) 推荐(0) 编辑

2013年1月10日

摘要: function goTop() {$('html, body').animate({scrollTop:0}, 'slow'); }function goDiv(div) {var a = $("#"+div).offset().top;$("html,body").animate({scrollTop:a}, 'slow'); }function goBottom() {window.scrollTo(0, document.documentElement.scrollHeight-document.d 阅读全文

posted @ 2013-01-10 15:21 shenyixin 阅读(7718) 评论(0) 推荐(0) 编辑

2012年12月28日

摘要: 刚刚碰到一个要为html select添加readonly属性的要求,可是select是不支持readonly属性的,找了找,方法还是有的,不过大都比较麻烦。以下的方法个人认为是最简单的:<select id="lstTest" onfocus="this.defaultIndex=this.selectedIndex;" onchange="this.selectedIndex=this.defaultIndex;"><option value="1">test1</option&g 阅读全文

posted @ 2012-12-28 13:55 shenyixin 阅读(335) 评论(0) 推荐(0) 编辑

2012年12月20日

摘要: class Program { static void Main(string[] args) { zhishuDemo(100); } /// <summary> /// 求质数(素数) /// </summary> /// <param name="n">范围</param> public static void zhishuDemo(int n) { List<int> list = new List<int>()... 阅读全文

posted @ 2012-12-20 13:08 shenyixin 阅读(271) 评论(0) 推荐(0) 编辑

2012年12月11日

摘要: JS:<body><select name="PaymentType" style="width:110px" > <option value="">请选择 </option> <option value="001">月付</option> <option value="002">半年付</option> <option value="003">年付</optio 阅读全文

posted @ 2012-12-11 16:46 shenyixin 阅读(89473) 评论(0) 推荐(3) 编辑

2012年12月6日

摘要: //新建工作簿 Workbook workbook = new Workbook(); //工作簿 Worksheet sheet = workbook.Worksheets[0]; //工作表 Cells cells = sheet.Cells;//单元格 sheet.Protect(ProtectionType.All, "123123", "");//保护工作表 sheet.Protection.IsSelectingLockedCellsAllowed = false;//设置只能选择解锁单元格 sheet.Protection.IsFormat 阅读全文

posted @ 2012-12-06 12:50 shenyixin 阅读(582) 评论(0) 推荐(0) 编辑

2012年11月26日

摘要: ChinaUnionPay: 1 <html> 2 3 <head> 4 <title> 5 ChinaUnionPay Example 6 </title> 7 <script language="javascript" type="text/javascript"> 8 // 验证信用卡或银联卡卡号是否符合标准, 9 // 如果符合返回true,否则返回false.10 function validateCard(number) ... 阅读全文

posted @ 2012-11-26 14:52 shenyixin 阅读(1587) 评论(0) 推荐(1) 编辑