我正在着陆页上工作,底部有4或5个视频,每个视频缩略图上都有一个播放按钮图标。每个视频都是通过javascript加载的,每个视频都是h5文本。当您单击任何视频的播放按钮时,它会将视频移动到主视频部分(视频点1) - 并将视频点和视频中的视频和文本移动到刚刚单击的视频点。我有视频切换,但我很难抓住h5的文本。以下是我目前在HTML中的内容
<div class="row video-section-main-row"">
<div class="col-xs-12 main-vid-col">
<div id="player" class="hidden"></div>
<a href="#/" class="play-icon-main" id="play-button-1"><img src="images/play-icon-largest.png"></a>
<img class="main-video vid-spot" id="video-spot-1" src="">
<h5 class="main-video-headline" id="video-headline"></h5>
</div>
</div>
<div class="row video-section-thumbnail-row">
<div class="col-xs-3 video-col">
<img id="video-spot-2" src="">
<a href="#/" class="play-icon" id="play-button-2"><img src="images/play-icon-largest.png"></a>
<h5 id="video-thumbnail-headline-1"></h5>
</div>
<div class="col-xs-3 video-col">
<img id="video-spot-3" src="">
<a href="#/" class="play-icon" id="play-button-3"><img src="images/play-icon-largest.png"></a>
<h5 id="video-thumbnail-headline-2"></h5>
</div>
<div class="col-xs-3 video-col">
<img id="video-spot-4" src="">
<a href="#/" class="play-icon" id="play-button-4"><img src="images/play-icon-largest.png"></a>
<h5 id="video-thumbnail-headline-3"></h5>
</div>
<div class="col-xs-3 video-col">
<img id="video-spot-5" src="">
<a href="#/" class="play-icon" id="play-button-5"><img src="images/play-icon-largest.png"></a>
<h5 id="video-thumbnail-headline-4"></h5>
</div>
</div>
答案 0 :(得分:1)
在播放按钮的点击处理程序中:
var videoText = $(this).siblings('h5').text();