Linksammlung KW 06+07 2011

by: Dirk Siemers | posted: February 18th, 2011

Und schon wieder Freitag… keine Zeit… gespeicherte Links der letzten 2 Wochen raussuchen, Blogeintrag schreiben und schnell weiter an sovido arbeiten.

Ruby + Rails

Webdev

Sonstiges

Code Schnipsel

toggle details in 2nd table row
%table#videos
    %thead
        %tr
            %th Heading 1
            %th Heading 2
    %tbody
        - @videos.each do |video|
            %tr.video{:id => "video-#{video.id}"}
                %td Info 1
                %td Info 2
            %tr.video-details{:id => "video-details-#{video.id}"}
                %td{:colspan => 2}
                    %p= video.to_yaml

:css
    .video-details { display:none; }
    .video-details td { padding: 0 1em; }
    .hover { background: #ddd; }

:javascript
    $(document).ready(function(){
        $(".video").hover(function () {
            $(this).css("cursor", "pointer");
            $(this).addClass("hover");
        }, function () {
            $(this).removeClass("hover");
        });
        $(".video").click(function(event){
            $(this).next("tr").toggle();
        });
    });    
Fork me on GitHub