jQuery代码仅在页面加载时运行,而在页面完全加载后无法运行,该怎么办?
$('.slider').click(function() {
console.log('hassan');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="slider">
<button style="background-color:transparent" id="left-arrow" class="glyphicon
glyphicon-menu-left"></button>
</div>
答案 0 :(得分:1)
我想你早些时候正在调用一个函数,
$('.slider').click(someFunction());
而不是这样做,
$('.slider').click(someFunction);
注册点击事件的功能。 您随附的代码段可以正常工作。
答案 1 :(得分:0)
从您的div中删除课程滑块,并将其放入按钮课程
DECLARE @HighestBagNumber INT;
DECLARE @BatchNumber CHAR(8);
SET @BatchNumber = 37708;
SELECT @HighestBagNumber = MAX(BagNumber)
FROM FSD3BagLog
WHERE BatchNumber = @BatchNumber
SELECT BatchNumber, BagNumber, CumulativeWeight
FROM FSD3BagLog
WHERE BagNumber = @HighestBagNumber
AND BatchNumber = @BatchNumber