原创 Jquery文件上傳-代碼實現

//前臺預覽代碼 html代碼部分 <label>頭像:</label> <img src="images/timg.jpg" alt="" id="headerImg"> <input type="file" id="fi

原创 使用cookie實現首次打開時觸發

// 首次點開觸發 var res = document.cookie.indexOf("name"); if(res!=0){ var oDate =new Date(); d

原创 下拉加載更多

$(window).scroll(function() { var oh = $('.orderBox .loading').height(); //獲取開始加載的參考標籤距離 var allh

原创 自定義滾動條樣式

.tabBox .aroundList::-webkit-scrollbar {width: 4px;height: 13px;background: #eee;} .tabBox .aroundList::-webkit-scrol

原创 移動端 回到頂部按鈕特效

html部分 <div class="gotop"></div> .gotop{position: fixed;width: 1rem;height: 1rem;z-index: 200;right: .3rem;bottom: 1.

原创 選項卡切換

$(’.nav li’).click(function(){ $(this).addClass(‘curr’).siblings().removeClass(‘curr’); var i = $(this).index(); $(’.

原创 div限制文本超出部分...代替

單行: overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 2行: display: -webkit-box; -webkit-box-orient: ver

原创 移動端回到頂部 根據距離顯示

var h2_height = $(".searchbox").offset().top;//獲取一個元素距離頂部距離 $(window).scroll(function(){ var this_scrollTop = $(this)

原创 ps切圖

photoshop 擴展功能 cutterman ps插件 cutterman 下載安裝,重啓後在窗口擴展功能中

原创 jQuery實現導航欄的樣式切換

樣式: ul{ margin: 0 auto; height: 50px; background-color: #369; } ul>li{ text-decoration: none; display: inline-b

原创 js實現選項卡效果

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{

原创 響應式佈局

響應式佈局:(media queries)媒體查詢 相當於一套html配多套css樣式 @media screen and (min-width: 1080px) {…} @media screen and (max-width:

原创 JQuery ajax實現

//登錄 $('#btnlogin').bind('click',function () { //獲取參數 $phone = $('#txtPhone').val(); $passwor

原创 移動端閃屏 設置

樣式部分 h5動畫 向左移出100% ,用時0.8s @keyframes slideOutLeft { from{ transform: translateX(0); } to{

原创 php文件下載的實現方式

一、直接下載 超鏈接下載,文件類型爲可執行文件exe或者壓縮文件zip 可以通過超鏈接直接連接文件地址下載 <a href="res/a.zip">直接下載</a> 二、文件讀取的方式 在文件類型、大小未知的情況下 讀取文件內容,