次のような構造の HTML ドキュメントがあります。
<section id="page1" data-role="page">
<a href="#" id="next-section" class="next-section" style=" cursor:e-resize"><div class="arearight" alt="go right" ></div></a>
<a href="#" id="prev-section" class="prev-section" style=" cursor:w-resize"><div class="arealeft" alt="go left" ></div></a>
...
</section>
<!-- more sections -->
そして、それをトラバースする次のコードがあります
$(":jqmData(role='page')").each(function() {
$(this).bind("swipeleft" goLeft); //goLeft and goRight are defined and working
$(this).bind("swipeleft", goRight);
//...
}
スワイプは正常に動作していますが、 andnext-section
をprev-section
呼び出すclick
動作にバインドしたいのですが、オブジェクトを介してそれらにアクセスする方法がわかりません。彼らにたどり着く方法を知っている人はいますか?goLeft
goRight
$(this)
ありがとう