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

Rollover triggering an action

Community Beginner ,
Sep 12, 2018 Sep 12, 2018

Hello,

I'm new to Captivate.

I'd like to create a button who will trigger an action when I rollover it... not when I click on it.

Is it possible with Captivate?

277
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 Expert ,
Sep 12, 2018 Sep 12, 2018

Out of the box, Captivate has only one 'hover' event which could trigger an action. That is for the Rollover Slidelet. It is possible to create events with either the HTML widget by InfoSemantics or with JS.

However, hope you are aware of the fact the Rollovers will NOT work on any mobile device, only when a mouse is used which means a laptop or a desktop? Is it a good idea to use that event?

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
Engaged ,
Sep 12, 2018 Sep 12, 2018
LATEST

Here's how you can do this using JS.  

1. Give the object the id hover

2. On enter frame execute the following javascript:

var obj = document.querySelectorAll("[id^='hover']")[1];

obj.addEventListener("mouseenter", function(e) {

//Add your action here. 

cp.alert('Object has been hovered over')

});

As Lilybiri has said, you probably want to have a click action as well for mobile devices.  

 

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