page jump from div to an anchor

前端 未结 3 1680
隐瞒了意图╮
隐瞒了意图╮ 2020-12-17 15:19

I was trying to make a div jump from FAQ to a div id and could success easily, but since I have a fixed link to ju

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 15:59

    As long as your anchor has an ID you can link to a location in your view by clicking the div you will just need some javascript.

    Setting the window.location.hash value will put the focus of the view on the selected ID.

    Sample

    Test
    
    

    JSFiddle Example

提交回复
热议问题