Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jqueryを使用してスライダーペインのすべてのリンクを無効にするにはどうすればよいですか?
基本的に<a href...私の親div内のすべてのシングル
<a href...
$('.classname-of-parent-div').on('click', 'a', function (e) { e.preventDefault(); });
//You could alse use $('a') if you want to disable ALL links $('.sliding-pane a').click(function(e) { e.preventDefault(); });
それを試してみてください。
$(document).ready(function() { $("#slider").on('click', 'a', function(event) { event.preventDefault(); alert('no navigation'); }); });
ライブデモ jQueryPreventDefaultの詳細はこちら