gpt4 book ai didi

javascript - Angularjs 与 css3 动画

转载 作者:行者123 更新时间:2023-11-28 10:51:08 25 4
gpt4 key购买 nike

我有以下代码

<a href="#local-container" >X</a>

因此,单击此链接时,url 会更改为

http://localhost:8088/#/local-container

在 angularjs 中,这个问题是我必须从我的 css 中捕获点击的事件元素,以便在以下代码中为 dom 元素设置动画,

#local-container:target{
left:0px;
width:10px;
}

显然它不会工作,因为 hashtag 与上面 css 中的 div id 不同。

那么还有其他方法可以实现动画吗?或者我是否必须更改 angularjs 中的 url 模式?

最佳答案

我认为您正在寻找类似 $anchorScroll() 的东西。

Here is the documentation

关于javascript - Angularjs 与 css3 动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22786795/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com