http://jsfiddle.net/builtbymay/Wge4n/4/で、Basecampの召喚状ボタンの上にマウスを置き、ブラウザウィンドウの左側にマウスを移動します。1000msの遅延の後、見出しが元に戻ることに気付くでしょう。良い!ここでもう一度マウスを置きますが、今回はマウスをHighriseの上に移動します。よくない!
Basecampボタンにマウスを合わせるときに発生する遅延を高速化する必要があると考えています。clearTimeoutが機能しませんでした。どんな助けでもいただければ幸いです。ありがとう!
$(document).ready(function() {
var delay = 1000;
$('.products .bc').on('mouseenter', function() {
$('header').addClass('hidden');
$('.bc:first').removeClass('hidden').css({
'clear': 'both',
'width': '829px',
'height': '163px',
'margin': '0 auto',
'padding': '6px 0',
'text-align': 'center',
'font-family': '"CrimsonSemiBold", "Times New Roman", Georgia, serif',
});
// Added bc:first to prevent styles being added to other .bc classes.
$('.bc:first h1, .bc:first p').css('padding', '18px 0 0');
// Adjusting vertical layout so red arrow more closely matches location on 37signals.com.
$('.bc:last').css('box-shadow', '0 0 10px #333');
});
$('.products .bc').on('mouseleave', function() {
setTimeout(function() {
$('header').removeClass('hidden');
$('.bc:first').addClass('hidden').removeAttr('style');
$('.bc:last').removeAttr('style');
}, delay);
});
$('.products .hr').on('mouseenter', function() {
$('header').addClass('hidden');
$('.hr:first').removeClass('hidden').css({
'clear': 'both',
'width': '829px',
'height': '163px',
'margin': '0 auto',
'padding': '6px 0',
'text-align': 'center',
'font-family': '"CrimsonSemiBold", "Times New Roman", Georgia, serif',
});
$('.hr:first h1, .hr:first p').css('padding', '18px 0 0');
$('.hr:last').css('box-shadow', '0 0 10px #333');
$('.right-arrow-b').removeClass('right-arrow-b').css({
'left': '80px',
'position': 'relative',
'z-index': '1'
});
});
$('.products .hr').on('mouseleave', function() {
setTimeout(function() {
$('header').removeClass('hidden');
$('.hr:first').addClass('hidden').removeAttr('style');
$('.hr:last').removeAttr('style');
$('.right-arrow-b').addClass('right-arrow-b').removeAttr('style');
}, delay);
});
$('.products .cf').on('mouseenter', function() {
$('header').addClass('hidden');
$('.cf:first').removeClass('hidden').css({
'clear': 'both',
'width': '829px',
'height': '163px',
'margin': '0 auto',
'padding': '6px 0',
'text-align': 'center',
'font-family': '"CrimsonSemiBold", "Times New Roman", Georgia, serif',
});
$('.cf:first h1, .cf:first p').css('padding', '18px 0 0');
$('.cf:last').css('box-shadow', '0 0 10px #333');
$('.left-arrow').removeClass('left-arrow').css({
'left': '150px',
'position': 'relative',
'z-index': '1'
});
});
$('.products .cf').on('mouseleave', function() {
setTimeout(function() {
$('header').removeClass('hidden');
$('.cf:first').addClass('hidden').removeAttr('style');
$('.cf:last').removeAttr('style');
$('.left-arrow').addClass('left-arrow').removeAttr('style');
}, delay);
});
});
参考:CSSとHTMLは別のクラスメートから借りたものです。私の仕事は、プロセスでHTMLとCSSを編集せずに、37signals.comの動作を反映するように動作を取得することでした。多くのcss操作が発生しています。無視してください。私の最後のタスクは、上記の問題を解決することです。ありがとう!