milohuang / reverie

Reverie is a versatile HTML5 responsive WordPress framework based on ZURB's Foundation.
http://theakiba.com/reverie/
MIT License
916 stars 196 forks source link

Zurb Reveal jQuery fn #35

Closed Sparticuz closed 12 years ago

Sparticuz commented 12 years ago

Here's some code I wrote to automatically turn any Wordpress generated thumbnail into a modal Reveal from Foundation's reveal plugin:

        jQuery(function($) {
            $(".size-thumbnail").each(function(index){
                var html;
                var parent = $(this).parent();
                html = "<div id='reveal-"+index+"' class='reveal-modal'>";
                html +="<img src='"+parent.attr('href')+"' />"
                html += "</div>";
                parent.attr("data-reveal-id","reveal-"+index);
                $("body").append(html);
            });
        });

I put it in footer.php

milohuang commented 12 years ago

Sounds interesting!