Skip to content

Instantly share code, notes, and snippets.

@yahelc
Last active August 29, 2015 14:11
Show Gist options
  • Save yahelc/279c40166aad18c0dfda to your computer and use it in GitHub Desktop.
Save yahelc/279c40166aad18c0dfda to your computer and use it in GitHub Desktop.
$(".content-wrapper").hide();
$("head").append("<style>#cboxTitle{ font-size: 20pt; white-space:pre; } #cboxLoadedContent{ display:inline; } #cboxCurrent, #cboxContent button{ display: none !important;} #employeedetails, #employeename{ visibility:hidden} #cboxContent h1, #cboxContent img { padding: 1em; } #cboxContent{padding:2em; }</style>");
$("img").addClass("pic").each(function(){ return $(this).attr("href", this.src).attr("title", $(this).closest("article").clone().find('span,script,.phone').remove().end().text().replace(/ /g,"").trim()+"\nJoined "+ $(this).closest("article").data("startdate").replace(/\%/g,"")) });
$(".pic").colorbox({transition: 'fade', rel:'pic', slideshow:true, width:"99%", height:"99%", opacity: 1, slideshowSpeed: 8000});
$("#cboxContent").css({"background-color": "white"});
$(document).bind('cbox_complete', function(){
var title = $("#cboxTitle").text().split("\n").filter(Boolean);
var html = "<h1 id=employeename>" + title.shift() + "</h1>";
html += "<div id=employeedetails>" + title.join("\n") + "</div>";
$("#cboxTitle").html(html);
setTimeout(function(){
$("#employeename").css('visibility','visible').hide().fadeIn()
setTimeout(function(){
$("#employeedetails").css('visibility','visible').hide().fadeIn()
}, 2000);
}, 2000);
});
$("img:eq(0)").click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment