这里的想法是,每当用户单击图像时,他或她都可以在上面的框中查看有关该人的信息。它以前工作过,然后突然停止了。这是我正在谈论的页面的链接和我的代码。
代码:
<script type="text/javascript">
jQuery(document).ready(function($){
$('#team_pics img, #team_pics2 img').click(function(){
$('#team_description').html('<img src="' + $(this).attr('src') + '" />' + $(this).next().html());
});
});
</script>
<div id="team_description">
<h1>Click on a picture below to learn more about a team member</h1>
</div>
<div id="team_container">
<div id="team_pics">
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_chase.png" width="100px" height="100px" style="padding: 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Chase Schweitzer</b></span><br>-Third year in FTC<br>-Designer, builder, webmaster<br>-Interests: programming (HTML, CSS, BASIC, Javascript, etc.), web design, music, writing<br>-Plays the guitar and violin</p></div>
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_annie.png" width="100px" height="100px" style="padding: 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Annie Howard</b></span><br>-Second year in FTC<br>-Designer, builder, writer<br>-Interests: music, writing, history, anthropology<br>-Plays the ukelele, sings</p></div>
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_tanvi.png" width="100px"height="100px" style="padding: 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Tanvi Yenna</b></span><br>-Second year in FTC<br>-Designer, builder, engineering notebook organizer<br>-Interests: designing, music, writing, and acting<br>-Plays the piano, guitar and ukelele; sings</p></div>
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_jordan.png" width="100px" height="100px" style="padding: 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Jordan Burklund</b></span><br>-Fourth year in FTC, two years in FLL<br>-Designer, builder, programmer<br>-Interests: robotics/mechatronics engineering, aviation, and music<br>-CLAD certified</p></div>
</div>
<div id="team_pics2">
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_saketh.png" width="100px" height="100px" style="padding: 0px 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Saketh Undurty</b></span><br>-Fourth year in FTC, two years in FLL<br>-Designer, builder<br>-Interests: 3D modeling/design, architecture, and music<br>-Plays trumpet in concert band and jazz orchestra</p></div>
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_daniel.png" width="100px" height="100px" style="padding: 0px 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Daniel Miller</b></span><br>-Third year in FTC<br>-Designer, builder, promotions<br>-Interests: architecture, graphic design, music<br>-Viola player, mime, and thespian</p></div>
<img src="<? bloginfo('stylesheet_directory'); ?>/images/pixel_sidd.png" width="100px" height="100px" style="padding: 0px 30px;"/>
<div class="caption"><p class="caption_paragraph"><span class="caption_header"><b>Sidd Somayajula</b></span><br>-Third year in FTC<br>-Designer, builder, webmaster<br>-Interests: medicine, math, web design, programming (HTML, CSS, BASIC, Javascript, etc.)<br>-Plays tennis</p></div>
</div>
</div>