As the title says, what I want to achieve is to slide the mobile phone screen. When an element is a certain value from the top (for example, 200px), click the pop-up button on the screen, and the position of the pop-up layer will be 200px from the top
$(document).ready(function(){
$('.content_box').bind('touchstart', function(e) {
var a =$(".article_box").offset().top;
distance = a;
console.log(distance);
});
});
//执行函数
function show_taboo(){
if(distance>200){
alert("出现了")//做处理
}else{
alert("隐藏")、、处理
}
What I want to achieve is this effect. The value of distance can be obtained, but it cannot be referenced in the show function. Can you please help me?
The solution found is as follows:
$(document).ready(function(){
//Define function
function test(){
}
//Execute function
function show_taboo(){
}