0

Grid3 を Grid2 に移動しようとしています - このコードを使用していますが、機能していません。何が間違っていますか?

また、Grid3 の Div の半分を Grid1 に移動し、残りの半分を Grid2 に移動する方法はありますか?

JS

$("#grid3").appendTo("#grid2");

HTML

        <div class="wrapperA1">
            <div class="content">
                <div id="home-sectionD">
                    <div id="grid1"><!--Gird 1-->   

                        <article class="testimonial">
                        <img alt="Neal Kilburne​​" src="assets/images/neal kilburne​​.jpg"/>
                            <div>
                                <h3>Neal Kilburne​​&lt;/h3>
                                <p>CEO, iTEQ Global www.iteqglobal.com</p>
                                    <br>
                                <p>“Loai is a great asset to our company and provides us with great and quick responses,Such a talented designer which we have the honour of working with.” 2011 - 2012</p>
                            </div>  
                        </article>

                        <article class="testimonial">
                            <div>
                                <h3>Amanda Chui​&lt;/h3>
                                <p>Owner of www.beautyroom.ca</p>
                                    <br>
                                <p>Just what my website needed! When I had finished my website, I felt that it was missing something,so I enlisted in the help of Loai. He did a great job of giving my website the professional and polished look it needed without having me wait for days on end. Thanks, Loai!” June 23, 2012</p>
                            </div>
                        </article>

                    </div><div id="grid2"><!--Gird 2-->     

                        <article class="testimonial">
                            <img alt="Geeta Martinez" src="assets/images/geeta martinez.jpg"/>
                            <div>
                                <h3>Geeta Martinez</h3>
                                <p>Lawyer &amp; Business Consultant</p>
                                    <br>
                                <p>"Leo did a great job! He designed and put together several websites for me in less than a week. He was incredibly patient and flexible throughout the whole process, and took a lot of the stress out of the whole situation for me. He is a really nice guy to work with - I really appreciated his approach! I would definitely recommend working with him". July 14, 2013</p>
                            </div>  
                        </article>

                        <article class="testimonial">
                            <div>
                                <h3>Richard Jackson</h3>
                                <p><em>Photographer www.rjpstudios.co.uk​&lt;/em></p>
                                    <br>
                                <p>“Loai designed my website last year on wix though I could have done it myself loai added a proffesional touch to the design which is so important in creating the best first impeson.” 2013</p>
                            </div>
                        </article>  

                    </div><div id="grid3"><!--Gird 3-->         

                        <article class="testimonial">
                            <img alt="Glen Eric Huysamer" src="assets/images/glen eric huysamer.jpg"/>
                            <div>
                                <h3>Glen Eric Huysamer​&lt;/h3>
                                <p>Specialist Service Provider.</p>
                                    <br>
                                <p>“I would like to take this opportunity to warn people who might consider using Loai Design Studio. You will have to buckle up and strap yourself in as this young designer and associates take you through the process of creating your design needs. I was pleasantly surprised from start to finish, and can say that even though Loai took control of the creative process the end result felt like it was mine. You can not go wrong with this young lad, go ahead surprise yourself”. December 30, 2011</p>
                            </div>
                        </article>

                        <article class="testimonial">
                            <div>
                                <h3>Ciprian Filip​&lt;/h3>
                                <p>Founder of Pontomat.ro​&lt;/p>
                                    <br>
                                <p>“Worked with Loai on designing exposure of our social media presence on Facebook for our E-commerce initiative. He is very passionate and expert in his field of work, coming with breakthrough innovations in real time. He is able to manage an end to end social media exposure with accent on clarity, effectiveness and innovation. His working capabilities are awesome and I am sure that he will make good contribution to any project he works on.”  August 4, 2011</p>
                            </div>
                        </article>

                    </div>                      
                </div>
            </div>
        </div>
4

2 に答える 2

0

移動は機能します (イベントなどでドキュメントが読み込まれた後にコードを実行している$(document).ready()場合)。要素の開発者コンソールをチェックインして (Chrome を使用している場合)、#grid3実際に内部に#grid2あることを確認します。

<div id="grid2">...
    <article...>
    <article...>
    <div id="grid3">...
</div>

grid3内部のコンテンツを移動したい場合は、 and をgrid2使用して記事を取得する必要があります。これにより$('#grid3').find('article').appendTo('#grid2')、 から記事が削除されgrid3、 に挿入されgrid2ます。その一部を動かすには、 と を分離し、article一方を に挿入しgrid1、他方を に挿入しgrid2ます。

于 2013-08-22T13:21:57.220 に答える