How do I know which javascript function is being triggered when I click a button and how do I trigger that manually?


I am attaching a screenshot of my site with a corner highlighted. when I click on the pause button the gallery in the background pauses.

I know the following things:
There is a javascript attached that contains a function that I think causes this to happen. The javascript is and the code is function pauseBgVideo(){ if(activePlayer=='youtube') ytplayer.stopVideo(); else if(activePlayer=='vimeo') $f(vmplayer).api('pause'); else if(activePlayer=='jwplayer') jwplayer('jwP').pause(); $('.pauseVideoBL').hide(); $('.playVideoBL').show(); }
On the main HTML of the page that wordpress generates there is a div with class pauseVideoBL that calls the pauseBgVideo() function
The class of the pause button itself is currentItemPaused and it only appears when the mouse is over the button

I have tried the following functions in the header without any success:
$(document).ready(function(){ $j(document).find(".currentItemPaused").trigger("onclick") });
$(document).ready(function(){ $j(".videoBL").find(".pauseVideoBL").trigger("click") });
$(document).ready(function(){ pauseBgVideo() });

Please help! I need to be able to pause the background gallery when I click on menu items in the top right hand corner.

Any assistance will be appreciated.

The website is:

Screenshot of homepage
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You want to look at the plug in documentation.  Which plug in or js is running the background and what is the url to the developers site.  We can look there for the api.
NerdsOfTechTechnology ScientistCommented:

Open in new window

NerdsOfTechTechnology ScientistCommented:
Or on each link:
use the


Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

badwolfffAuthor Commented:
Hi NerdsOfTech,

It doesn't work. I tried it. In fact I have left that code on the site.

badwolfffAuthor Commented:
I've requested that this question be deleted for the following reason:

Seems like it can't be solved. I've tried everything and have gotten fed up.
So I have changed the wordpress template and it all works fine now.
thanks anyway
NerdsOfTechTechnology ScientistCommented:
You had the onclick and href on your <li> instead of your <a> tag (what I referred to as LINK in my answer) and you have a href on your <a> that needs to be voided (with href="#")

<li data-tip="Pause Video" id="menu-item-62" class="mBL pauseVideoBL menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home"><a href="#" onclick="pauseBg();"><span class="title">Home</span><span class="description"></span></a>

<li data-tip="Pause Video" id="menu-item-63" class="mBL pauseVideoBL menu-item menu-item-type-post_type menu-item-object-page"><a title="Sculture" href="#"  onclick="pauseBgVideo();"><span class="title">Sculture</span><span class="description"></span></a></li>

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
badwolfffAuthor Commented:
Ok thanks I will try it tomorrow
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Actually, you want to use, href="javascript:void(0)" instead of href="#"

Glad you have it working.  Sometimes those WP templates are not coded very well.
NerdsOfTechTechnology ScientistCommented:
@scott javascript: void(0) isn't applicable here since he wants to run javascript code and that would void out the click.

However, he could optionally code: href="javascript: pauseBgVideo();" and omit the onClick call.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.