123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>jQuery UI Portlet</title>
- <!-- jquery 1.4 and jquery ui 1.8 -->
- <link rel="stylesheet" href="../lib/themes/1.8/start/jquery-ui-1.8.5.custom.css" />
- <link rel="stylesheet" href="../css/jquery.portlet.css?v=1.1.3" />
- <script src="../lib/jquery-1.4.4.min.js" type="text/javascript"></script>
- <script src="../lib/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
- <!--<link rel="stylesheet" href="../lib/themes/1.9/start/jquery-ui-1.9.1.custom.min.css" />-->
- <!--<script src="../lib/jquery-1.8.3.js" type="text/javascript"></script>-->
- <!--<script src="../lib/themes/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>-->
- <script src="../script/jquery.portlet.pack.js"></script>
- <style>
- body {font-size: 13px;}
- .highlight-content {color: red;}
- </style>
- <script>
- $(function() {
- $('#portlet-demo').portlet({
- sortable: true,
- singleView: true,
- columns: [{
- width: 350,
- portlets: [{
- attrs: {
- id: 'feeds'
- },
- title: function() {
- var d = new Date();
- return '正常宽度';
- },
- icon: 'ui-icon-signal-diag',
- content: {
- //设置区域内容属性
- style: {
- height: 100
- },
- type: 'text',
- text: '这里是内容。。。。。'
- }
- }]
- }, {
- width: 350,
- portlets: [{
- attrs: {
- id: 'news'
- },
- title: function() {
- return '内容二';
- },
- icon: 'ui-icon-document',
- content: {
- style: {
- height: 100
- },
- type: 'text',
- text: '这里是内容。。。。。'
- }
- }]
- }]
- });
- $('#portlet-demo1').portlet({
- sortable: true,
- singleView: true,
- columns: [{
- width: 700,
- portlets: [{
- attrs: {
- id: 'aaaa'
- },
- title: function() {
- var d = new Date();
- return '跨2列';
- },
- icon: 'ui-icon-signal-diag',
- content: {
- //设置区域内容属性
- style: {
- height: 100
- },
- afterShow: function() {
- var top = 0;
- var left = 0;
- var index = $(this).index('.ui-portlet');
- var topp = $('.ui-portlet').eq(index == 0 ? 0 : index - 1).find('.ui-portlet-column');
- $.each(topp, function() {
- if (top < $(this).height()) {
- top = $(this).height();
- }
- });
- $(this).css('position', 'absolute').css({
- left: 7,
- top: top + 10
- });
- },
- type: 'text',
- text: '我要跨列...'
- }
- }]
- }]
- });
- });
- </script>
- </head>
- <body>
- <hr class='ui-widget-content' />
- <div id='portlet-demo'></div>
- <div id='portlet-demo1'></div>
- <!-- 模板 -->
- <div id="newsTemplate" style="display:none">
- <ul>
- <li><a href='http://www.kafeitu.me/'>http://www.kafeitu.me</a></li>
- <li><a href='https://github.com/henryyan'>https://github.com/henryyan</a></li>
- </ul>
- </div>
- </body>
- </html>
|