製作這個頁面,產生一些心得,謹記如下
0. Code rules
0.1 JavaScript behavior can only effects on tags, but not
function within attributes' selves.
0.2 CSS style could not only apply to tags, but also write
into "class" as sub-attributes of each tag.
0.3 "onMouseOver" &"onMouseOut" events would even active on
"td" or "tr" tags of table.
1. Table properties:
1.1 To extend active area, we could first put linked texts
into table cells, then move JavaScript events from hyper
-linked text(so called "selector" or "a" tag) to the
relevant cell(on "td" tag) which contents above texts.
1.2 We could make use of CSS style in "table" tag, to redefine
table's attributes including "frame", "ruler" and "border".
1.3 If you intent to make the whole row(contending several
cells) to change background on mouse over, you should
insert the JS behavior into "tr" tags instead of "td" tags.
2. Avoiding unwanted white gaps
2.1 Never apply external CSS style to texts within table cells,
you should set text style within "tr", "td" or "table" tags.
If you must define two or more text styles within single table,
try the "class" attribute to define separate styles.
2.2 "Cell height=100%" was an unreliable attribute, it may not
fill the rest field properly, which could end up with unwanted
white gaps between cells.
3. Rules failure
3.1 One widely spread approach of creating pop up menu by "show-hide
layers" behavior, may not be a proper way. For the pop up menu
disappears right away once the mouse leaves "onMouseOver" active
area or slips into "onMouseOut" region.
3.2 The notice rule goes on DW4.0, "You needn't draw a layout table
first before creating a layout cell, Dreamweaver will automatically
draw a layout table for the layout cell." May not be effective in
DWMX, which only draws automatically the very first layout table
for you, and no longer creates layout table while we draw the rest
layout cells. You have to nest the table by yourself.
---
--
※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw)
◆ From: 203.73.7.84