我在我的网站上使用HTML5 Player。当单击视频时,我想重定向到另一个URL。在Chrome和IE中一切正常,但是在Firefox中这是行不通的。当我单击视频时,它也不起作用。
这是一个代码:
<li class="sliderSlide"
<?php if(isset($homeSlider->effect->title) and $homeSlider->effect->title!='')
{
echo 'data-transition="'.$homeSlider->effect->title.'"';
}
else {
echo 'data-transition="fade"';
} ?> >
<img class="bigImgHide" src="<?= $homeSlider->getImg($homeSlider->id) ?>">
<div id="video<?= $homeSlider->id ?>" class="bg-video-wrapper" style="margin: 0 auto;">
<video class="home-page-video" muted width="100%" height="100%" loop="false" height="auto" width="auto" controls autoplay="autoplay" src="<?=$homeSlider->getVideo($homeSlider->id)?>" onclick="self.location = '<?=$homeSlider->link?>';"></video>
<div class="bg-video-overlay bg-dark-alfa-50"></div>
</div>
</li>
我尝试使用:window.location.href = "https://www.example.com";
window.location.assign("https://www.example.com");
window.location.replace("https://www.example.com");
self.location = "https://www.example.com";
和
top.location = "https://www.example.com";
但是在Firefox中没有任何作用...