我不太了解javascript,我不得不在网站上工作,接受某人的编码,并且它有一些脚本控制着包含标签的左侧菜单,基本功能是显示内容选中特定选项卡时选项卡,但在一个需要上传视频或doc / pdf文件等文件的选项卡中,页面成功上传但内容设置为隐藏,如果我点击任何其他选项卡然后去回到有问题的,再次出现内容。
<script>
$(document).ready(function(){
window.scrollTo(0,0);
var activeTabID = window.location.hash
if(activeTabID != '')
{
$('.tab').hide().removeClass('active');
$(activeTabID).show().addClass('active');
var tabID = activeTabID.replace('#', '');
tabID = "#show" + tabID.charAt(0).toUpperCase() + tabID.slice(1);
$(tabID).parent().addClass('currenttab');
}
</script>
&#13;
<div class="left-menu">
<h2>Edit</h2>
<ul class="tabButtons">
<li data-tab-id="showTab2" data-tab-title="Manage Video"><a href="javascript:{}" id="showTab2" rel="#tab2">Manage Video</a></li>
</ul>
</div>
&#13;
然后从另一个.js文件调用其他一些函数
function graduatesectionhlt(){
clicked = $(this);
$('.currenttab').not(clicked).removeClass('currenttab');
$(clicked).addClass('currenttab');
tabID = clicked.data('tab-id');
if (tabID) {
if ($.cookie('current-tab-id')!=tabID) {
$.cookie('prev-tab-id', $.cookie('current-tab-id'));
$.cookie('prev-tab-title', $.cookie('current-tab-title'));
$.cookie('current-tab-id', tabID);
$.cookie('current-tab-title', clicked.data('tab-title'));
}
if ($('#back') && $.cookie('prev-tab-id')) {
$('#back').html('<a href="javascript:{}" onclick="$(\'#'+$.cookie('prev-tab-id')+'\').click();">Back to '+$.cookie('prev-tab-title')+'</a>');
}
}
}
$(document).ready(function(){
//Graduate account highlight current tab
//on page load make sure none are highlighted then highlight the first one
//$('.currenttab').removeClass('currenttab');
//$('.tabButtons li:first-child').addClass('currenttab');
//bahaviour for when one of the tabs is clicked
$('.tabButtons li').click(graduatesectionhlt);
//Create tab functions, Loop through tab buttons and create switch function for each one
$('.tabButtons li a').each(function(index){
var actualIndex = index + 1;
var buttonID = '#showTab'+actualIndex;
$(buttonID).click(function(){
$('.tab').hide().removeClass('active');
$($(this).attr('rel')).show().addClass('active');
});
});
&#13;
<div id="tab2" class="tab">
<h1><?php echo '<a href="'.$editProfileURL.'">'.$name.'</a>'; ?></h1>
<form method="post" action="<?php saveVimeo(); ?>">
<div id="vimeoPreview">
<?php echo $video; ?>
</div><!-- End vimeoPreview -->
<h2>Video</h2>
<a class="top-tips-link button" href="<?php echo BASE_URL; ?>manage-video-top-tips">Manage Video Top Tips</a>
<p>It is essential that you add your video clip here. This will propel your details to the top of an employers search list, hence it will give you a fantastic level of exposure to employers immediately. The video clip is one of the main reasons why employers love to use Newtongrads. So, its best to get started on this section now.
Your video must be hosted at <a target="_blank" href="http://vimeo.com" class="video-link">Vimeo.com</a>. It's totally free. If you already have an account with<a target="_blank" href="http://vimeo.com" class="video-link"> Vimeo</a>, great! Otherwise, <a target="_blank" href="http://vimeo.com" class="video-link">setting up an account</a> only takes a minute. Then, simply copy and paste your video's link below and hit the <b>Save</b> button.</p>
<label for="vimeo">Enter the Vimeo id number (the last part of the Vimeo url)</label>
<input type="text" name="vimeo" id="vimeo" value="<?php echo $info['vimeo']; ?>" />
<input type="submit" name="addVideo" value="Save" />
<div style="height: 204px; left: 305px; position: relative; bottom: 108px;">
<img src="_images/vimeo.jpg" />
</div>
</form>
</div><!-- End tab2 -->
&#13;
出于某种原因,当我将文件上传到#tab2的服务器时,显示设置为none,因为它被分配了.tab类。
有人可以帮我解决这个问题:(我无法弄清楚所有这些代码。