私は、parent()/children()/find() とセレクター構文の太陽の下ですべての組み合わせを試してきました。仕事!どなたか見ていただけると本当にありがたいです..
ポートフォリオセクションに移動すると、ここでライブを見ることができます-> 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;
});
});
本当にそうです、ありがとう!