Skip to content

Instantly share code, notes, and snippets.

@Barneybook
Barneybook / key.html
Created July 5, 2013 03:20
CDN不存在就使用本地端的js
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/lib/jquery-1.4.2.min.js"%3E%3C/script%3E'))</script>
@Barneybook
Barneybook / md.md
Last active March 1, 2016 04:52
鎖定 textarea
锁住这个textarea,如何锁住哪?
很简单,只需要一个css属性:resize:none;
——————–
查了一下文档,resize可以设置如下的属性:
none:UserAgent没提供尺寸调整机制,用户不能操纵机制调节元素的尺寸。
both:UserAgent提供双向尺寸调整机制,让用户可以调节元素的宽度和高度。
@Barneybook
Barneybook / index.html
Created April 3, 2013 04:08
A CodePen by Barney Chen.
<li class="a"></li>
<li class="b"></li>
<li class="c"></li>
<li class="d"></li>
<li class="e"></li>
<li class="f"></li>
<li class="g"></li>
<li class="h"></li>
<li class="i"></li>
<li class="j"></li>
@Barneybook
Barneybook / weblist.markdown
Last active December 14, 2015 02:59
iframe access parent and child (use jquery)
access child:
var $f = $("iframe");
$f[0].contentWindow.functionName();
access parent:
parent.functionName();
@Barneybook
Barneybook / weblist.markdown
Last active December 14, 2015 01:09
Forward and Back Buttons javascript http://www.pageresource.com/jscript/jhist.htm
Foward and Back Buttons
How to make JavaScript history buttons
Well, you want to make a back button- but you want the button to take the viewer back to the page they just came from, which may not have been one of your pages. This kind of back button would act like the back button on a web browser. Well, if you really want to have one, you can do it with a nifty little javascript. Here it is:
<FORM>
<INPUT type="button" value="Click here to go back" onClick="history.back()">
</FORM>
@Barneybook
Barneybook / memo.markdown
Last active December 13, 2015 21:08
workspace memo
@Barneybook
Barneybook / iframe.js
Created February 8, 2013 10:28
Iframes Memo
window.frames['FRAME_ID'].history.go(-1);
// 往前一頁面
window.frames['FRAME_ID'].history.go(1);
// 往下一頁面
<img
alt="Chrome"
id="logo"
src="//tools.google.com/chrome/intl/en/images/chrome-canary-lockup.png"
style="
-webkit-mask:
-webkit-gradient(radial, 17 17, 123, 17 17, 138, from(rgb(0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, 0.2)), to(rgb(0, 0, 0)));
"
>