如何最小化&在jsp中最大化表

时间:2011-04-19 10:48:21

标签: java jsp

我想尽量减少&在jsp中最大化我的表。 我该怎么办?

提前感谢。

2 个答案:

答案 0 :(得分:0)

使用javascript进行操作 请参阅此example

答案 1 :(得分:0)

               **//here is the script**

  <script src="Scripts/Jquery.js" type="text/javascript"></script>
 <script type="text/javascript">
    jQuery(function ($) {
        $('#min1').click(function () {
            var iframeheight = $('#iframe1').width();
            if (iframeheight == 934) {
                $('#iframe1').width(462);
                document.getElementById('divFrame2').style.display = "block";
            }
        });
        $('#max1').click(function () {
            var iframeheight = $('#iframe1').width();
            if (iframeheight == 462) {
                $('#iframe1').width(934);
                document.getElementById('divFrame2').style.display = "none";
            }
        });
        $('#min2').click(function () {
            var iframeheight = $('#iframe2').width();
            if (iframeheight == 934) {
                $('#iframe2').width(462);
                document.getElementById('divFrame1').style.display = "block";
            }
        });
        $('#max2').click(function () {
            var iframeheight = $('#iframe2').width();
            if (iframeheight == 462) {
                $('#iframe2').width(934);
                document.getElementById('divFrame1').style.display = "none";
            }
        });
    });
     </script>

    **//style**
     <style type="text/css">
    .bdr
    {
        border: 1px solid #6593cf;
    }
  </style>

  **//aspx sample**
   <form id="form1" runat="server">
    <table><tr><td >
    <div id="divFrame1" class="bdr">
        <div>
            <img id="min1" src="Images/Minimize.jpg" width="13" height="14" border="0" alt="" />
            <img id="max1" src="Images/Maximize.jpg" name="Image6" width="13" height="14" border="0"
                id="Image6" alt="" />
        </div>
        <iframe name="content" id="iframe1" src="http://www.dynamicdrive.com/forums/archive/index.php/t-2529.html"
            frameborder="0" height="321" width="462"></iframe>
       </div>
    </td ><td >
    <div id="divFrame2" class="bdr">
        <div>
            <img id="min2" src="Images/Minimize.jpg" width="13" height="14" border="0" alt="" />
            <img id="max2" src="Images/Maximize.jpg" name="Image6" width="13" height="14" border="0"
                id="Image7" alt="">
        </div>
        <iframe name="content" id="iframe2" src="http://www.w3schools.com/default.asp" frameborder="0"
            height="321" width="462"></iframe>
    </div>
    </td></tr></table>
    </form>