2016年3月22日 星期二

Published 上午8:19 by with 0 comment

jQuery 筆記 - 我在ALPHACamp 第27天


製作 todo list ( CRUD功能 )

HTML: 製作 U & D

基本:

用 ul + id 把整張表包起來

製作一個checkbox.

用 Span 非 Div (目的 : 內容同軸on-line)


製作 U :

製作一個 input 的欄位

value 宣告欄位內的內容




製作 D : 

自訂屬性: data-action




製作C:


最後在底部新增一個

新增鍵




CSS 排版:

ul {
  list-style-type: none;
在HTML內使用 ul 最前方會有一個點, 用這方法刪除
  padding-left: 0;
靠左

#todo-list [type="text"]

#todo-list .editing .content

#todo-list .editing [type="text"]

#todo-list [data-action="delete"]

display: none;
隱藏


#todo-list li:hover [data-action="delete"]

display: inline;
隱藏




jQuery
順序:
  // create
  // click @+button
  // show prompt
  // get prompt result
  // clone li
  // replace clone content by new one
  // append to todo-list



      edit

0 意見:

張貼留言