我一直在尝试在 parent()/children()/find() 和选择器语法的阳光下的每一种组合,以 .show() 我隐藏在文档准备好的网页元素,但我就是无法得到它工作!如果有人可以看看我真的很感激..
如果你去投资组合部分,你可以在这里看到它 -> http://holly.im/。
无论如何,html看起来像这样:
<div id="portfolio">
<h1>Heading</h1>
<div class ="little_column">
<div class="project">
<a href="#c++_games_engine_construction" class="projlink"> click </a>
</div>
</div>
<div id="c++_games_engine_construction" class="big_column">
<?php include "projects/C++_game_engine_construction.php"; ?>
</div>
</div>
和相关的jQuery:
$(document).ready(function() {
//hide all the big_columns /
// project details within the portfolio page
$('#portfolio').find('.big_column').hide(); //This seems to be working
});
$(function(){
$('.project').click(function () {
var selectedProject =
$(this).children('a.projlink').attr('href');
$(this).parent().parent().find(selectedProject).show(); //My most recent attempt, I though maybe i needed to go up the heirachy then back down? But whatever i try it doesn't show.
return false;
});
});
真的是这样,谢谢!