twitter-bootstrap 如何将关闭最小化全屏按钮添加到引导面板

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24190616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 20:57:25  来源:igfitidea点击:

how to add close minimize full screen button to bootstrap panel

jquerytwitter-bootstrap

提问by user3489866

i want to add a close and minmize button to hide and close the body panel pannel and to full screen button to every bootsrap panel in the page using jquery

我想添加一个关闭和最小化按钮来隐藏和关闭主体面板面板,并使用 jquery 将全屏按钮添加到页面中的每个引导面板

    <div class="panel panel-primary">


        <div class="panel-heading">

            <h3 class="panel-title"><i class="fa fa-bar-chart-o"></i>  Number Of Tickets Reported In The Billing Unit (Today)</h3>
        </div>
        <div class="panel-body">
            <div class="flot-chart">
                <div id="BillPhChart"></div>
            </div>
        </div>
    </div>
</div>

回答by AntoineLev

You will have to use jQuery to perform these tasks. Then the buttons should simply call the corresponding jQuery functions.

您将不得不使用 jQuery 来执行这些任务。然后按钮应该简单地调用相应的 jQuery 函数。

Here are some quick hints I just found :

以下是我刚刚发现的一些快速提示:

Minimize / Maximize div's with jQuery

使用 jQuery 最小化/最大化 div

http://plugins.jquery.com/tag/fullscreen/

http://plugins.jquery.com/tag/fullscreen/

Here is an example for the button :

这是按钮的示例:

<a href="#" class="btn"><i class="icon-white icon-plus"></i></a>

The hrefbeing the jQuery function.

href是jQuery的功能。

EDIT: To individually trigger the panels, give each one of them an unique id and create a JavaScript function that calls the jQuery using the id selector to identify it.

编辑:要单独触发面板,给每个面板一个唯一的 id 并创建一个 JavaScript 函数,该函数使用 id 选择器调用 jQuery 来识别它。

$( "#myID" )

You can find the id of the panel that triggered the event using this :

您可以使用以下命令找到触发事件的面板的 ID:

event.target.id