javascript - When two spans are clicked respectively, a ul list will appear. Click ul. Is the value of li assigned to the currently clicked span?
某草草
某草草 2017-06-07 09:24:55
0
1
854

I wrote two spans
When clicked respectively, the ul list can appear, but when the ul li is clicked, the values ​​​​of the two spans are all attached.
When one of them changes The other one will also change accordingly. My original intention was to click on that one and ask God to solve it

某草草
某草草

reply all(1)
世界只因有你

This is what your code looks like. If you want to achieve the effect you want, you need to create a variable in home and work, such as

var isJiatin = true;    //我们默认是家庭
$('.jiatin').on('click', function(){
    isJiatin = true;
    $('.shequ ul li').show();
})
$('.danwei').on('click', function(){
    isJiatin = false;
    $('.shequ ul li').show();
})
$('.shequ ul li').on('click', function(){
    //先判断是家庭还是社区
    //do something 
})

Just the sauce

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!