新しいjQueryであるため、コードを組み合わせてdivを左側から右側にアニメーション化してからスライドダウンするのに問題があります。スライドダウン前の div の高さは約 10px で、スライドダウンすると高さ 351px になります。上記を別々に行うことはできますが、組み合わせることはできません!! 少しご指導いただければ幸いです、よろしくお願いします。これが私の現在のコードです。
$.hideAllExcept = function(tabs,boxes){
function init() {
// make it bookmarkable/refreshable. but, no history.
var hash = window.location.hash;
(!hash) ? hideShow('#' + $(boxes+':first').attr('id')) : hideShow(window.location.hash);
// add click handler.
$(tabs).click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
// add back the hash which is prevented by e.preventDefault()
window.location.hash = href;
hideShow(href);
});
}
function hideShow(el) {
$(boxes).animate({"left": "-650px"}, "slow");
$(el).fadeIn('slow').animate({"left" : "60%",height:"351" }, 1000);
$(tabs).removeClass('active');
$('a[href="' + el + '"]').addClass('active');
}
init();
};
少し進みました!!一時サーバーで実行しています:
http://www.tridentsolutions.co.nz/test-folder/index.html#construction_home
しかし、ボックスを LHS に戻すことはできません。また、テキストが html にあり、div の画像ではないため、テキストがどのように表示されるかを確認できません。つまり、テキストを非表示にできないということですか? 前もって感謝します
(function($){
$.hideAllExcept = function(tabs,boxes){
function init() {
// make it bookmarkable/refreshable. but, no history.
var hash = window.location.hash;
(!hash) ? hideShow('#' + $(boxes+':first').attr('id')) : hideShow(window.location.hash);
// add click handler.
$(tabs).click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
// add back the hash which is prevented by e.preventDefault()
window.location.hash = href;
hideShow(href);
});
}
function hideShow(el) {
$(el).animate({"left": "-650px"}, "slow").fadeIn('slow');
$(el).fadeIn('slow').animate({"left" : "60%" }, 1000).animate({"height" : "351" }, 1000);
$(tabs).removeClass('active');
$('a[href="' + el + '"]').addClass('active');
}
init();
};