Created
August 22, 2013 05:29
-
-
Save cathornton/6303496 to your computer and use it in GitHub Desktop.
CSS Snippet for blog post at: http://sp-thornet.blogspot.com/2013/08/jquery-image-lightbox-for-sharepoint.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Lightbox Styles */ | |
/* Lightbox for image hyperlinks */ | |
img.ms-rteImage-LightBox { | |
-ms-name: "LightBox"; | |
width: 12px; | |
margin:0px !important; | |
cursor: pointer; | |
} | |
/* Lightbox for text hyperlinks */ | |
a.ms-rteElement-LightBox { | |
-ms-name: "LightBox"; | |
text-decoration:underline; | |
font-weight:bold; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://sitecollection/Style Library/Scripts/jquery.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// JQuery snippet for popup box on hyperlinks: | |
$("a.ms-rteElement-LightBox").click(function(){ | |
SP.UI.ModalDialog.showModalDialog({ | |
url: $(this).attr("href"), | |
title: $(this).attr("title") | |
}); | |
return false; | |
}); | |
// JQuery snippet for popup box on images: | |
$('img.ms-rteImage-LightBox').on('click',function(){ | |
SP.UI.ModalDialog.showModalDialog({ | |
url: $(this).parent("a").attr("href"), | |
title: $(this).parent("a").attr("title") | |
}); | |
return false; | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CT: this css stylesheet is referenced in v4.master so I have added | |
the below to fix the MS Modal Dialog on the page 21/08/13 */ | |
.ms-dlgContent { | |
position:fixed !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment