0

私のHTML

<div class="item-page">
  <div class="Introduction">
    <div class="FrTxtLoans">
      <h1 class="uppercase"> home-mortgage </h1>
    </div>
  </div>
  <div id="main_content">
    <div class="landing_wrapper"> </div>
  </div>
</div>

私の質問

私がやりたいのは、周りのすべてのダイビングを削除することです<div class="landing_wrapper"> </div>

私のスクリプト

私が使用 $('.item-page').replaceWith($('.landing_wrapper'));していて、それは魅力のように機能します。

ここでjsFiddleを参照してください

私の問題

ウェブサイトでMooToolsとjQueryの競合があるため、ウェブサイトjQuery.noConflict();の上部で使用し、名前を変更しました

$('.item-page').replaceWith($('.landing_wrapper'));

jQuery('.item-page').replaceWith($('.landing_wrapper'));

その後、replaceWithは機能を停止しました。jQueryConflctjsFiddleはこちら

問題を見せてくれませんか?

4

1 に答える 1

1

元のコードは実際にはjQueryオブジェクトを2回呼び出していたため( )、2番目の例では、の両方のインスタンスを$に置き換える必要があります。$jQuery

jQuery('.item-page').replaceWith(jQuery('.landing_wrapper'));
于 2012-10-23T23:35:46.140 に答える