jQuery依視窗大小做排列

  • 1604
  • 0

今天在網路上看到jQuery的應用...學習記錄一下...

可以讓元件依照視窗大小自行計算一列要放幾個...

今天在網路上看到jQuery的應用...學習記錄一下...

可以讓元件依照視窗大小自行計算一列要放幾個..

.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $(window).resize(function () {
                $("#container").css('width', $(window).width());
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="container">

       <%--加入元件--%>
    </div>
    </form>
</body>
</html>

=====================================================

資料來源:

http://itseer.blogspot.tw/2012/03/css-and-jquery.html

Jenny:
    陽光令人愉快,雨水令人振作,
    風聲令人奮起,雪花令人興奮,
    沒有所謂的壞天氣!!
    只有不同的好天氣!!