Revision: This seems to work best on or with Publishing Pages. Errors might occur within document libraries, list libraries, the Edit screen/dialog for documents, etc.
————————————-
I had to stop a slide show from running and allow me to actually edit a page without getting in the way. I built the slide show originally, so it was my baby. I had to find a way let my script detect when the page was in edit mode.
Searching the net gave me a wide range of solutions that were all over the place. I need something simple and easy; SharePoint 2010 HAS to have a session state…. Good thing it uses a built-in JavaScript variable to do just this called g_disableCheckoutInEditMode. Go ahead and try it:
$(document).ready(function() {
if(!g_disableCheckoutInEditMode)
{
*insert what you want to do when not in edit mode*
}
});