{"issue":{"created_at":"2011-11-20T20:04:47Z","state":"open","updated_at":"2011-11-20T20:07:59Z","user":{"gravatar_id":"1e7d7573adbc1cf06b6da777a7769003","id":229384,"url":"https://api.github.com/users/kevinrenskers","login":"kevinrenskers","avatar_url":"https://secure.gravatar.com/avatar/1e7d7573adbc1cf06b6da777a7769003?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"I'm using bootbox to create lightbox-like image popups from thumbnails.\r\n\r\nMarkup:\r\n\r\n    <ul class=\"media-grid\">\r\n        <li>\r\n            <a href=\"/large.png\" data-lightbox=\"lightbox\" title=\"Image title\">\r\n                <img class=\"thumbnail\" src=\"small.png\" alt=\"\" />\r\n            </a>\r\n        </li>\r\n    </ul>\r\n\r\nHelper JS function:\r\n\r\n    $('[data-lightbox]').click(function(e) {\r\n        e.preventDefault();\r\n\r\n        var href = $(this).attr('href');\r\n        var width = $(window).width() - 80;\r\n        var height = $(window).height() - 80;\r\n        var title = '';\r\n\r\n        if ($(this).attr('title')) {\r\n            title = $(this).attr('title');\r\n        }\r\n\r\n        bootbox.lightbox('<img src=\"'+href+'\" alt=\"\" style=\"max-width:'+width+'px;max-height:'+height+'px;\" />', title);\r\n    });\r\n\r\nI've put the helper function inside another javascript file with random bits and pieces, but this could be copied to the bootbox file of course.","assignee":null,"id":2297887,"number":10,"pull_request":{"patch_url":"https://github.com/makeusabrew/bootbox/pull/10.patch","html_url":"https://github.com/makeusabrew/bootbox/pull/10","diff_url":"https://github.com/makeusabrew/bootbox/pull/10.diff"},"labels":[],"title":"New lightbox function","closed_at":null,"html_url":"https://github.com/makeusabrew/bootbox/issues/10","milestone":null,"url":"https://api.github.com/repos/makeusabrew/bootbox/issues/10"},"action":"created","comment":{"created_at":"2011-11-20T20:07:59Z","updated_at":"2011-11-20T20:07:59Z","user":{"gravatar_id":"1e7d7573adbc1cf06b6da777a7769003","id":229384,"url":"https://api.github.com/users/kevinrenskers","login":"kevinrenskers","avatar_url":"https://secure.gravatar.com/avatar/1e7d7573adbc1cf06b6da777a7769003?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Bootbox is an awesome way to quickly create nice modal popups. However, Bootbox only provided alert and dialog-like functionality, without headers, etc. This lightbox function is basically a way to use the entire array of bootstrap modals.\r\n\r\nJust realized... maybe the new function should be called bootbox.modal?","id":2807551,"url":"https://api.github.com/repos/makeusabrew/bootbox/issues/comments/2807551"}}