Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom Close Button Javascript

Community Beginner ,
Dec 20, 2012 Dec 20, 2012

I'm having trouble with a custom javascript button when exporting to both swf and html 5 with AICC LMS settings.

When just using html5 output the button works fine, here's the contents of the script window:

window.open('', '_self', '');

window.close();

The first line was added because Firefox prevented the window from being closed unless it was opened with the window.open() method.

However, even with the fix, when swf output is also selected in the publish settings the window won't close at all.

I am wondering if perhaps because the index.html file in the AICC output is choosing either the html5 or the swf through the line - newFrame.src="index_AICC.html"; That the fact that it is opening within a frame somehow the javascript isn't able to close the top window? I've played with all the Javascript settings in Captivate as far as changing the target window to top, parent, self, etc. with no success.

Any suggestions on making a custom Window Closing Button that works in both html5 and flash, while using AICC?

22.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 21, 2012 Dec 21, 2012

You might be interested in the link below:

Click here to view

Cheers... Rick

Translate
Adobe Employee ,
Dec 21, 2012 Dec 21, 2012

Hi,

Have you tried using the following method--

Edit -- Preferences -- Start and End -- At the End of the project -- Choose Drop down item -- Close Project.

CloseProject.jpg

Verify the results with Both SWF as well as HTML5 output on your AICC based LMS.

In case, it doesn't work, please switch browsers like -- IE9, Chrome, Safari for HTML5 output and others for SWF. Compare their results this way.

Thanks,

Anjaneai

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 21, 2012 Dec 21, 2012

Thanks for the suggestion, this did allow the close button to work in the HTML5 output ( The client's project requirements needed a close button on every slide, so i just made a "Close" button which jumped to the last slide, and changed the Project End Options to close project.)

However, when I try to do the same thing in the SWF output, the window stays open and is just stuck on the last frame, regardless of what is clicked. I checked this across Firefox, IE, Chrome, Safari (all latest updates) and even follow Harpreet's suggestion to Enable all Javascript interactions (though the end users who will view the module may or may not do the same, so that could be an issue.)

I even disabled the LMS option to see if that would change the outcome, but still no luck, so i guess that is not a factor?

To sum up, this solution partially worked because it was effective for the HTML5 output, but for some reason won't function for the SWF output.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2012 Dec 21, 2012

You might be interested in the link below:

Click here to view

Cheers... Rick

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2012 Dec 21, 2012

Hello Captiv8r,

I cannot agree with your link that describes the inability to close a Captivate project as not being Captivate's fault.

Why? 

1. Because I too am suffering through this issue with Captivate 6 (reason why I found this post). I am relatively new to Captivate (well, haven't used it in a while) but prior to Captivate, I used a many other rapid eLearning tools such as Articulate products, RWD uPerform, and pure Flash... AND I have never encountered such problems with opening content in a separate window and closing the eLearning window.

2. My company has prior examples of eLearning (tools used - unknown) where they always (company 'standard') pop up in their own windows and they all have close buttons that close the learning window.

Why is this so difficult in Captivate?
Why doesn't Captivate have built in tools/widgets/whatever that handle such basic functions?

Like so many other learning developers, I want to know how to open my lessons in their own windows and I want to have a functional custom button that closes the learning window.

That isn't so much to ask for, especially when there are so many examples of other content that does this.

Sorry, don't mean to come across as rude. I see you are one of the super helpers in this forum, and we all appreciate your efforts.

But please understand my frustration when my boss comes to me and asks why I haven't fixed this opening/closing problem. I have searched high and low and nothing seems to work.

Thanks for listening,

Doug

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2012 Dec 21, 2012

Hi Doug

No offense taken.

You can choose to agree or not. It really doesn't matter. And I'm not trying to be rude either. Only trying to state the facts as I know them to be.

One way to easily have you see what I mean is by trying the following:

Generate Captivate as a SWF with an HTML page and enable the Full Screen option.

When the Full Screen option has been used, you get a second HTML page. When you run that second HTML page, you simply see a link that allows you to open the Captivate output in a larger windows devoid of toolbars and such.

Now, close the browser and locate the Captivate output files on your hard drive. Open the HTML page that presents Captivate. You should see that the Exit button either fails with no message (Chrome or Firefox) OR presents a message that the page is trying to close (IE). The net result is that the page simply doesn't close.

Now launch the page containing the link to open in full screen. You get just a link. You click the link and a new window appears. In that new window, you should be able to easily close the Captivate using the Exit button. This is because the Captivate output was opened in a child window. And from this, you should see that it's browser behavior that controls the ability to close. Captivate's doing all it can do by simply issuing a command to close the window. It's then up to the browser to allow that to happen. And it's all in the way the browser window was opened to begin with that controls it.

I cannot speak to other applications and their ability or perceived ability to close windows. There are lots of variables and it's quite possible they were dealing with the windows in different ways.

Keep in mind that if you are testing locally off your C drive, the exit button may also fail due to Flash Player Security Settings and you may need to add the testing folder to the list of trusted locations for the Flash Player.

Cheers... Rick

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2013 Apr 25, 2013
LATEST

I too struggled to get a working exit button and had one working until I started using the multiscreen.html ( Captivate 6 ) so that users are directed to html5 if their browsers support it. Unfortunatly the multiscreen.html code does not open a child window that would allow my close button to work and I was not able to find any posts that resolved this (let me know if you have a solution).

My solution was to use a fancybox that has an exit button on it to display the captivate project (works great for all browsers, project recorded in 995 x 627):

<script type="text/javascript">

$(document).ready(function () {

          $("#btn_acceder").click(function () {

                    //window.open(/url/multiscreen.html');

                                 $.fancybox({

                    //'orig'          : $(this),

                                           'type'            : 'iframe',

                    'href': '/url/multiscreen.html',

                    'width'          : 1020,

                    'height'          : 700,

  'autoScale' :false,

'enableEscapeButton' : true,

                    'transitionIn'          : 'none',

                    'transitionOut' : 'none'

                     });

                     return(false);

          });

});</script>

<div style="text-align: center;"><span class="mt30"></span><br />

<button class="btn_classique" id="btn_acceder"><span class="g"></span><span class="m">button text</span><span class="d"></span></button> </div>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Dec 21, 2012 Dec 21, 2012

In firefox goto Tool-->Options and click on the Content tab.

Under content check the option that says Enable Java Scrip and also click on the Exception button next to it and make sure all the 3 options are checked.

Restart Firefox and JavaScript Should work now.

Harpreet

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources