adding an onclick function

I’ve got a layer that contains a video iFrame and needed a script that, when clicking on a close button, would both hide the layer and send a stop command to the video.

Our IT guy edited the HTML to do this, adding a block of JS to the page and inserting an onclick= function to the button that executes the script that halts the playback.

I need to know how to insert this with FW. Cropping in the JS was easy. As the button does not contain a link and the target show / hide action doesn’t provide a hook, I can’t add things via extend and I don’t see any other way to do this.

Any suggestions?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Show / hide functions properly. All I need is to plug in the function.
Test page: http://ohair.com/_WebDesignResources/untitled1.html


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

(Cropping?) Dropping….
The show / hide was done via an Action.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Did you try using ScriptyLightbox3 as your solution? That handles stopping embedded media automatically. You can use it with either YouTube or Vimeo-hosted video, or make a page in the same document and host the media yourself. In either case, when the overlay is closed, the movie is removed from the page entirely (deleted from the DOM) and it stops playing as if you tripped over the power cord.

Walter

On Jun 18, 2014, at 11:02 AM, Trey Yancy wrote:

(Cropping?) Dropping….
The show / hide was done via an Action.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for the suggestion.
The work is done using code supplied by Wistia. All I need to do is to attach the onclick= function to the button. I assume that there is an “extend” hook somewhere.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

When you say button, do you mean an element that you have applied the Rollover Action to to trigger an effect? If so, then here’s what you need to do. First, remove the Rollover Action from the item you want to extend. Apply a manual external hyperlink to the item, and enter something meaningless like # in the URL field. Then click the Extended button, and New, and add onclick in the Name field and your code in the Value field. If they gave you a whole onclick=“some code here” thing to add to your link, just paste the part that is inside the quote marks, not the outer part. Freeway will write all that for you. Make sure that their code does not include “return false;” or “event.preventDefault();” anywhere in it, or this will not work.

Now, re-apply the Rollover Action to the item, and re-configure it to close your popup. What will happen here is that the Rollover Action will use the existing link (with onclick) but then add its own behavior to the click event. I tested this with something simple and dumb (a alert() call) so it may not work in your case. That will depend on the code they provide and how it is written.

Walter

On Jun 18, 2014, at 12:17 PM, Trey Yancy wrote:

Thanks for the suggestion.
The work is done using code supplied by Wistia. All I need to do is to attach the onclick= function to the button. I assume that there is an “extend” hook somewhere.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Actually, it’s a text item, but no matter. It is on the target layer, along with the video iFrame.

Dropping in a meaningless character as a link is a good workaround. I’ll give it a shot.

Thanks Walt.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, not just any meaningless character, mind you. It needs to be something that won’t disrupt the rest of the URL. Try either ? or #, or use javascript: (just like that – the word lower-cased, and the colon and nothing else).

Walter

On Jun 18, 2014, at 1:41 PM, Trey Yancy wrote:

Actually, it’s a text item, but no matter. It is on the target layer, along with the video iFrame.

Dropping in a meaningless character as a link is a good workaround. I’ll give it a shot.

Thanks Walt.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options