配置文件选项卡不起作用

时间:2018-03-26 18:29:16

标签: php html

我在个人资料页面上有3个标签:关于,消息和新闻源。新闻源工作正常,但当我点击或消息时,它仍保留在新闻源标签上,即使它显示http://localhost/demo/pan_peter_1#messages_div

我无法弄清楚为什么......

picture of tabs

<div class="profile_main_column column">
    <ul class="nav nav-tabs" role="tablist" id="profileTabs">
        <li role="presentation"><a href="#about_div" aria-controls="about_div" role="tab" data-toggle="tab">About</a></li>
        <li role="presentation"><a href="#messages_div" aria-controls="messages_div" role="tab" data-toggle="tab">Messages</a></li>
        <li role="presentation" class="active"><a href="#newsfeed_div" aria-controls="newsfeed_div" role="tab" data-toggle="tab">Newsfeed</a></li>
    </ul>

    <div class="tab-content">

        <div role="tabpanel" class="tab-pane fade" id="about_div">
            <?php echo $info; ?>
        </div>

        <div role="tabpanel" class="tab-pane fade in active" id="newsfeed_div">
            <div class="posts_area"></div>
        </div>

        <div role="tabpanel" class="tab-pane fade" id="messages_div">
            <?php
                echo "<h4>You and <a href='" . $username ."'>" . $profile_user_obj->getFirstAndLastName() . "</a></h4><hr><br>";

                echo "<div class='loaded_messages' id='scroll_messages'>";
                echo $message_obj->getMessages($username);
                echo "</div>";
            ?>

            <div class="message_post">
                <form action="" method="POST">
                    <textarea name='message_body' id='message_textarea' placeholder='Write your message ...'></textarea>
                    <input type='submit' name='post_message' class='info' id='message_submit' value='Send'>
                </form>
            </div>

            <script>
                var div = document.getElementById("scroll_messages");
                div.scrollTop = div.scrollHeight;
            </script>
        </div>
    </div>
</div>

0 个答案:

没有答案