Upload the script and image to a document library
Create a new Webpart Page
Add a CEWP (Content Editor) Webpart to the page and add the following script
<style type="text/css">
#simplemodal-container a.modalCloseImg {
//This is the image you uploaded
background:url('javascript/x.png') no-repeat;
width:25px;
height:29px;
display:inline;
z-index:3200;
position:absolute;
top:-15px;
right:-18px;
cursor:pointer;
}
#simplemodal-overlay {background-color:#000;}
#simplemodal-container {background-color:#333; border:8px solid #444; padding:12px;}
</style>
//This is the jQuery library see jQuery Cross Site Lists for an explanation
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
//This is the Simple Modal script you uploaded into a document library
<script type="text/javascript" src="javascript/jquery.simplemodal-1.3.3.min.js"></script>
Add another CEWP Webpart to the page (under the first one) and add the following script
<script>
function modalMe(){
//You need to enter your own page here
var src = "http://test/sites/test/LightBoxDemo/Lists/LightTasks/NewForm.aspx";
$.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">');
}
</script>
<input type="button" onclick="modalMe();" value="Open Modal Window" ></input>
Click the button and you should get something like this. If something goes wrong and you can't close the window just refresh the browser.
Is it possible to show only the body of an announcement using lightbox?
ReplyDeleteThanks.
stout27, you can create a custom page and display what you would like. A followup post gives you some basics. http://sharethefrustration.blogspot.com/2009/11/easy-sharepoint-lightbox-page.html
ReplyDeleteIf it's for display only you can use a jQuery tooltip. There are lots to choose from.