似乎(defn batch [in out max-time max-count]
(let [lim-1 (dec max-count)]
(async/go-loop [buf [] t (async/timeout max-time)]
(let [[v p] (async/alts! [in t])]
(cond
(= p t)
(do
(async/>! out buf)
(recur [] (async/timeout max-time)))
(nil? v)
(if (seq buf)
(async/>! out buf))
(== (count buf) lim-1)
(do
(async/>! out (conj buf v))
(recur [] (async/timeout max-time)))
:else
(recur (conj buf v) t))))))
仅在点击发布之间的临时点击:active
的瞬间应用background
颜色。我基本上想要应用(如果存在的话)在<button>
元素上发布单击后调用的伪类,以向查看器演示它已被切换。
<button>
更新:
我将button:active{
background:#FFFFFF;
}
更改为锚标记。但是,当我尝试
<button>
单击 #button-id:visited{ background:#FFFFFF; }
这是小提琴:
答案 0 :(得分:1)
Here's a list of all CSS pseudo-classes。什么都没有作为切换按钮。最好的办法是添加一个事件监听器,用于监听按钮上的单击,并添加或删除表示被切换的类。