gpt4 book ai didi

javascript - JS 脚本无法正常工作

转载 作者:搜寻专家 更新时间:2023-10-31 08:30:16 24 4
gpt4 key购买 nike

<分区>

JS代码:

function showCaption() {
var captionVis = $('.grey-box-caption-text').css('display');
if(captionVis = "none") {
$('.grey-box-caption-text').width(0);
$(this).find('.grey-box-caption-text').show().animate({'width': '464px'},750);}
} else {
$(this).find('.grey-box-caption-text').animate({'width': '0'},750,
function(){$(this).hide();});
}
};

$('.caption-container').click(function() {
showCaption();
return false;
}
);

HTML代码:

<div class="one-half column home-three-img">
<div class="caption-container">
<div class="grey-box-caption">
</div>
<div class="grey-box-caption-text">This is a caption test - Hopefully this works
</div>
</div>
<img src="images/3.jpg">
</div>

这行不通,我是 JS 菜鸟。请帮忙。

我正在尝试让字幕部分从左向右滑出。当我点击父容器时没有任何反应。当我再次单击时,我希望标题会弹出并隐藏。

我已经正确加载了 Jquery,并且有一个可用的 document.ready 函数。

WIP 链接 http://clients.pivotdesign.com/dev/annual_report_2014/index.html

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