0

How do i disable all the links in my slider panes using jquery?

Basically every single <a href... within my parent div

4

3 回答 3

1
$('.classname-of-parent-div').on('click', 'a', function (e) {
    e.preventDefault();
});
于 2012-08-14T14:03:28.313 回答
1

试试看。

$(document).ready(function() {
    $("#slider").on('click', 'a', function(event) {
        event.preventDefault();
        alert('no navigation');
    });
});​

现场演示

更多关于 jQuery PreventDefault的信息在这里

于 2012-08-14T14:11:16.487 回答
1
//You could alse use $('a') if you want to disable ALL links
$('.sliding-pane a').click(function(e) {
    e.preventDefault();
});
于 2012-08-14T14:04:16.330 回答