0

この機能をよりうまく機能させようとしていますが、解決策を見つけるのに問題があります。

ページを互いにフェードインおよびフェードアウトさせたい。なにか提案を?

        $('.edit-account').click(function(){

            $('#section-wrapper').detach();

            $('#inline-cont').load('../my-profile/edit-profile.html #inline_content');

            $('#inner-wrap').load('../my-profile/edit-profile.html #section-wrapper', function(){
                $('#close-account').click(function() {
                        $('#section-wrapper').detach();
                        $('#inline-cont').load('../my-profile/close-account.html #inline_content');
                        $('#inner-wrap').load('../my-profile/close-account.html #section-wrapper');
                });
            });
        });
4

1 に答える 1

0

ここにいくつかのオプションがありますが、コンテキスト/ CSS/HTMLがないと最適なソリューションが何であるかを判断するのは困難です。

  1. jQueryを使用してアニメーション化する(CSSプロパティの不透明度が最初に0に設定されていることを前提としています)

    $('#yourSelector')。animate({opacity:1}、1000、function(){//アニメーションが完了しました。});

.animateの詳細については、こちらをご覧ください:http: //api.jquery.com/animate/

  1. CSSトランジションを使用する(IE <10 http://caniuse.com/#search=transitionではサポートされていません)最初に不透明度を0に設定している場合は、要素のCSS不透明度プロパティを$('#yourSelector').css('opacity':'1'); DOMに読み込んだ後、 1​​に変更します。 CSSトランジションが残りを処理します。

    .yourSelector {-webkit-transition:opacity .2s ease-in 0s; -moz-transition:不透明度.2sイーズイン0s; -o-transition:不透明度.2sイーズイン0s; -ms-transition:opacity .2s ease-in 0s; 遷移:不透明度.2sイーズイン0s; }

于 2012-06-13T21:36:31.657 に答える