I am testing callout popup and its giving me very strage behaviour. Its working but only after second click. on first click its not working.

function divTestCallOutPopup_click(sender, args) {
    ExecuteOrDelayUntilScriptLoaded(CreateCallOutPopup, "callout.js");

function CreateCallOutPopup() {
    var targetElement = document.getElementById("divTestCallOutPopup");

    // configure options
    var calloutOptions = new CalloutOptions();
    calloutOptions.ID = 'notificationcallout';
    calloutOptions.launchPoint = targetElement;
    calloutOptions.beakOrientation = 'leftRight';
    calloutOptions.content = "aaa";
    calloutOptions.title = "bbb";

    var callout = CalloutManager.createNewIfNecessary(calloutOptions);
  • Do you experience the same behavior if you substitute SP.SOD.executeFunc? SP.SOD.executeFunc(“callout.js”, “Callout”, CreateCallOutPopup); – user17859 Aug 28 '13 at 4:31

Because you are trying to create popup after click. If you try to create callout on page load you can use it on first click.

That is the only way using callout

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.