Как обернуть портлет в div

0

Я знаю достаточно html и css для обработки большинства вещей, которые мне нужны, но я не лучший в JQuery. Поэтому мне нужна помощь.

Szenario:

У меня есть веб-страница, содержащая сортируемые портлеты jquery

body { min-width:100%; }
.column { width: 33%; float: left; padding-bottom: 100px;}
.portlet { margin: 0 1em 1em 0; }
.portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
.portlet-header .ui-icon { float: right; }
.portlet-content { padding: 0.4em; }
.ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
.ui-sortable-placeholder * { visibility: hidden; }
.boxmax{position:absolute;width:100%;height:100%;}


<div class="column">
    <div class="portlet">
        <div class="portlet-header">Feeds</div>
        <div class="portlet-content"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p></div>
    </div>
    <div class="portlet">
        <div class="portlet-header">News</div>
        <div class="portlet-content"><span>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</span></div>
    </div>
</div>
<div class="column">
    <div class="portlet">
        <div class="portlet-header">Shopping</div>
        <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
    </div>
</div>
<div class="column">
    <div class="portlet">
        <div class="portlet-header">Links</div>
        <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
    </div>
    <div class="portlet">
        <div class="portlet-header">Images</div>
        <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
    </div>
</div>


$(function() {
    $( ".column" ).sortable({
        connectWith: ".column"
    });
    $( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
                    .find( ".portlet-header" )
                    .addClass( "ui-widget-header ui-corner-all" )
                    .prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
                    .end()
                    .find( ".portlet-content" );
    $( ".portlet-header .ui-icon" ).click(function() {
        if($( this ).parents(".portlet-header").find("span")[0].className.match("ui-icon-minusthick") != null)
        {
            $( this ).parents(".portlet").css({"position":"absolute", "height":"90%", "width":"90%", "left" : "0.4%", "top" : "1.2%"});
        }
        else
        {
            $( this ).parents(".portlet").css({"position":"", "height":"", "width":"", "left" : "" , "top" : ""});
        }
        $( this ).toggleClass( "ui-icon-minusthick").toggleClass("ui-icon-plusthick" );
        <!--$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();-->


    });

    $( ".column" ).disableSelection();
});

До сих пор я пробовал:

http://jsfiddle.net/VHWHm/2/

  1. его Сортировка из одного столбца в другой столбец
  2. Он может максимизировать весь экран и сводить к минимуму предыдущую позицию

Я пытаюсь:

http://jsfiddle.net/VHWHm/1/

Вопрос:

Как я могу обернуть портлеты в сторону div, который реагирует на процентные значения

Вопрос:

если я нажимаю кнопку максимизации, портлет максимизируется до полного экрана (полный браузер). чтобы минимизировать портлет, возвращающийся в предыдущую позицию, теперь, если я помещаю один внешний div из портлетов в это время, при максимизации портлета следует максимизировать внутри родительского div только не в полноэкранном режиме. Как я могу достичь этого.

Заранее спасибо.

Теги:

1 ответ

0

вы можете изменить сценарий в соответствии с этим:

$(function() {
$( ".column" ).sortable({
connectWith: ".column"
 });
  $( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-   all"     )
.find( ".portlet-header" )
.addClass( "ui-widget-header ui-corner-all" )
 .prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
.end()
.find( ".portlet-content" );
 $( ".portlet-header .ui-icon" ).click(function() {
  $( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
  $( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();

 });

 $( ".column" ).disableSelection();
   });

РАБОЧАЯ ДЕМО

Ещё вопросы

Сообщество Overcoder
Наверх
Меню