jquery - 区分要在jquery中使用的h1标签
问题描述
我有两个带有内容标题和第二个标题的h1 标签。
我的问题是使用 jquery 时both the h1 tags get activated
。
我want the Second heading only to be used in jquery
。我如何实现它?
function animateText() {
TweenMax.from($('h1'), 0.8, {
scale: 0.4,
opacity: 0,
rotation: 15,
ease: Back.easeOut.config(4),
});
}
<h1 >Heading</h1>
<h1 >second heading</h1>
解决方案
您可以将 id 标签添加到元素:
<h1 id="not_using">Heading</h1>
<h1 id="use_this_one">second heading</h1>
然后通过他们的 id 来识别他们。
推荐阅读
- spring-boot - Spring Cloud Config Client - 具有相同前缀的聚合配置
- debugging - 在调试模式下运行 NPX 命令
- r - RStudio hist() 错误:x 必须是数字,当所有列都是数字时
- parsing - 为什么我的 PDDL 没有编译?解析错误
- python - 有没有办法从单个列表中制作字典,其中字典的键和值取自特定索引
- function - 变量似乎在 PowerShell 中的函数内部不起作用
- reactjs - 在反应js中的功能组件中单击按钮时的条件渲染
- node.js - 图片上传的意图
- http - 如何为 YouTube 直播添加字幕?
- c++ - 如何拥有可变数量的未知确定类型的参数?