Skip to content

Instantly share code, notes, and snippets.

View sabrinaluo's full-sized avatar
loading...

HiiTea sabrinaluo

loading...
View GitHub Profile
@sabrinaluo
sabrinaluo / img_radius.html
Last active August 29, 2015 14:11
img round, round corner, css图片圆角
<style>
img{
border-radius:10px;
}
</style>
<img src="xx.jpg">
@sabrinaluo
sabrinaluo / gist:6fa9fd7697bfbdfc2acf
Created December 9, 2014 04:44
find index of active element
<ul>
<li>item1</li>
<li class="active">item2</li>
<li>item3</li>
</ul>
<script>
$(ul).find(".active").index(); //return 1
</script>
@sabrinaluo
sabrinaluo / gist:440812106396219f1523
Last active August 29, 2015 14:11
find element index in array; check whether element is in array
var array = ["lily", "tom", "lucy"];
var ele1 = "lily";
var ele2 = "lucy";
var ele3 = "jack";
array.indexOf(ele1); // return 0
array.indexOf(ele2); // return 2
array.indexOf(ele3); //return -1; NOTE: element is not in the array if return -1