javascript函数代码:
function showPreview(source) {
var file = source.files[0];
if(window.FileReader) {
var fr = new FileReader();
console.log(fr);
var portrait = document.getElementById('avatar');...
经常会用到,判断浏览器窗口是否滚动到指定id的区域。
javascript代码:
function isScrolledIntoView(el) {
var elemTop = el.getBoundingClientRect().top;
var elemBottom = el.getBoundingClientRect().bottom;
var isVisible = (elemTop...
以下方法基于jQuery,使用前要先引用jquery库文件。
函数代码:
function CaoNiMaDeUc(){
$("a").each(function(index, element) {
try{
var thishref=$(this).attr("href");
var thisText=$(this).html();
if(thishref.indexOf...