我只是想知道如何禁用和启用jQuery事件?我有这个代码已经在页面准备好了:
$(".panzoom").panzoom({
$zoomIn: $(".zoom-in"),
$zoomOut: $(".zoom-out"),
$zoomRange: $(".zoom-range"),
$reset: $(".reset")
});
<button type="button" id="select">
<img src="img/svg/painter/anchor.svg">
</button>
我想更改它,以便当我点击#select
按钮时暂时禁用.panzoom
。我怎么能这样做?
答案 0 :(得分:0)
在panzoom库中看起来已经支持这个了:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
int count = (int)[[dictGroups objectForKey:@"0"] count];
return count;
}
var panzoomDisabled = false;
$('#select').on('click', function() {
if (panzoomDisabled) {
$(".panzoom").panzoom("enable");
} else {
$(".panzoom").panzoom("disable");
}
panzoomDisabled = !panzoomDisabled;
});