jquery - How do I reference this embedded iframe from javascript -


i using squarespace (in retrospect poor idea because of difficulty of customizing code), , need able identify vimeo iframe within div can use in javascript calls. however, javascript not recognize such iframe element existing. feel either it's impossible identify iframe shoved div (by squarespace), or missing selector. or pointers appreciated.

here's iframe trying embed squarespace:

<iframe src="http://player.vimeo.com/video/135481337?api=1&player_id=player1&wmode=opaque" width="500" frameborder="0" id="player1" class="vimeo" height="281"></iframe> 

here's embedded iframe:

<div class="sqs-video-wrapper" data-load="false" data-html="&lt;iframe src=&quot;http://player.vimeo.com/video/135481337?api=1&amp;amp;player_id=player1&amp;amp;wmode=opaque&quot; width=&quot;500&quot; frameborder=&quot;0&quot; id=&quot;player1&quot; class=&quot;vimeo&quot; height=&quot;281&quot;&gt;&lt;/iframe&gt;" data-provider-name="" >     </div> 

and here javascript:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>  <script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>        <script type="text/javascript">          jquery(document).ready(function() {              alert("this alert working");              // enable api on each vimeo video             jquery('iframe.vimeo').each(function(){                 froogaloop(this).addevent('ready', ready);             });              function ready(playerid){                 froogaloop(playerid).addevent('play', play(playerid));                 froogaloop(playerid).addevent('finish', onfinish);             }              function play(playerid){                 alert(playerid + " playing!");             }              function onfinish() {                 document.write('<style>.yui3-lightbox2-content {display: none !important;}</style>');             }          });     </script> 

i've taken working example of api seen in link.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -