0

这里的想法是,每当用户单击图像时,他或她都可以在上面的框中查看有关该人的信息。它以前工作过,然后突然停止了。这是我正在谈论的页面的链接和我的代码。

http://www.team3550.org/team/

代码:

    <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>
4

2 回答 2

1

您确实看到第 202 行是如何抛出 TypeError 的,对吗?

var top = $('#blog_right').offset().top - parseFloat($('#blog_right').css('margin-top').replace(/auto/,0));

未捕获的类型错误:无法读取未定义的属性“顶部”

我在此页面上没有看到任何以 blog_right 作为 ID 的元素。

于 2012-11-09T21:15:18.907 回答
0

在调用时在代码中放置断点jQuery(document).ready(function($){甚至不会停止。

于 2012-11-09T21:27:47.147 回答