Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:18:55+00:00 2026-05-30T22:18:55+00:00

I’ve got a page with an iframe . The iframe is using jquery.scrollTo to

  • 0

I’ve got a page with an iframe. The iframe is using jquery.scrollTo to detect the audio playback time and keep the contents, lyrics for example, linked to the right point in the audio.

Each line of text is being pulled from a mysql table. What I’m trying to do is to allow the user to click on a line in the <iframe> and have the audio in the parent page play at that point. Here’s the code that grabs the times, which exists after the jquery that handles the other audio functions:

<?php
include 'mysqlt.php';
$entries=mysql_query("SELECT * FROM `database`.`table`") or die(mysql_error()); 
while ($ent = mysql_fetch_object($entries)) {
$segment = $ent->index;
$starttime = $ent->time;
$nextline = $ent->time2;
$length = ($nextline - $starttime); ?>

That same information is also duplicated in the iframe source page along with the individual lines of lyrics. The jquery that uses this info follows:

$("#iframe_id").contents().find("#button_in_iframe<?php echo $segment;?>").bind("click", function(){
        audioplayer.currentTime = <?php echo $time;?>;
        audioplayer.play();
    }
<?php } ?>

This second part loops, echoed once for each each potential line in the iframe that can be clicked. #button_in_iframe<?php echo $segment;?> ends up as something like #button_in_iframe23 for the 23rd line.

I’ve got jquery loaded up in both the parent and the iframe. As far as I can tell, the syntax is what it should be. If I remove this bit of code, everything works normally. if it’s in there, the basic audio functions on the normal controls I have set stop working. So this is not only not working, but it’s causing everything else associated with the audio tag’s controls to stop working as well. I know that any small error in the audio controls’ jquery is enough to make it stop working, but in this case I’m not sure where the problem is.

Thanks in advance for any insights anyone might be able to offer.

update:
I’ve got it so it no longer crashes the audio tag. Now it’s more an issue of the iframe’s item not triggering an event. Here’s the code now:

$('#iframe_id').contents().find("button.loop2").bind("click", function() {
    alert ("test");
    }); 

I’m not getting any console errors except for a Google Maps imbedded in the page in another location. When i click the <button> with class loop2 in the iframe, all of which exist, nothing’s happening. That seems to be the root of the problem as it was earlier.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:18:57+00:00Added an answer on May 30, 2026 at 10:18 pm

    I figured out how to do it. I’ve set the loop on the parent to read as follows:

    play<?php echo $segment; ?> = function(){
            sfx.currentTime = sounds.getCueById(id).startTime;
            sfx.play();
        };
    

    Then in the iframe’s page, I’ve told each button to call parent.play<?php echo $segment;?>();

    I’m not sure why finding the tags in the iframe didn’t work, but no matter. This get’s the job done.

    Thanks, shanabus, for all the suggestions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.