Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ナビゲーションアイテムの1つがクリックされると、jQueryを使用してz-indexを0に変更するナビゲーションがあります。次に、2秒後にz-indexを2に変更します。
delay()を使用してみましたが、CSSを変更すると機能しないようです。
このようなsetTimeoutを使用します
$(elem).css('z-index','0'); setTimeout(function(){ $(elem).css('z-index','2'); },2000)
javascriptでは、setTimeoutまたはsetIntervalのいずれかを使用してそれを実現できます
setTimeout("javascript statement",milliseconds);
http://www.w3schools.com/js/js_timing.asp