Single page hide/show section based on current position

前端 未结 4 485
陌清茗
陌清茗 2021-01-15 01:40

I\'m working on a single page websites with each page organized into section tags. Every section is placed on top of each other. I need a way with jquery, where based on cur

4条回答
  •  离开以前
    2021-01-15 02:32

    Add an id to the links

  • About
  • Add an id to the section

    Add some jquery

    $("#about").click(function(){
        $("#about-content").show()
        $("#services-content").hide()
        $("#contact-content").hide()
    })
    

    WORKING EXAMPLE HERE

提交回复
热议问题