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

  • SEARCH
  • Home
  • 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 6088559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:59:55+00:00 2026-05-23T11:59:55+00:00

Hello everyone and thank you very much for your time. Basically what I am

  • 0

Hello everyone and thank you very much for your time. Basically what I am developing is a long list of videos on a webpage. I had a div tag that includes lets say 10 video links. These links open an iframe html that has the actual video embedded there. So parent page has no videos, just links, the anchors have href=”video.html”, video.html has video in it. Everything loads fine initially, but afterwards I also need a sort function. I made my sort function which sorts the videos. Onclick the videos change. The way this works it that the content inside the div is changed using .innerHTML = “”. The content does change, and I am able to see the new video links and preview images, however when I click on the images, the href link opens in a new window, or parent window, not sure, but not important because the Fancybox does not open, I tried a number of different things but still not results. So the question I am asking is why does Fancybox not work when anchor tags are changed dynamically. Please Help

Okay thank you, I am not sure exactly how to use .live and .bind but i will look into it. For now, here is my code

<div id="mask">
</div>
<script type="text/javascript" language="javascript">
populate();
function populate()
{
var mask=document.getElementById('mask');
mask.innerHTML = '';
mask.innerHTML = allvideos[3] + allvideos[0];
}
//Then allvideos[3] for example would be like <a href="videos.html"/>
//So up to this part everything works. But now if i try and do
</script>
<div onclick="change();" >doesntmatter</div>
<script>
//And the change function
function change() {
var mask=document.getElementById('mask');
mask.innerHTML = '';
mask.innerHTML = allvideos[3] + allvideos[0];
} 
</script>   

So basically same exact function but fancybox stops working. And right now the Fancybox code gets called in the beginning like this:

$(document).ready(function() { $("a.videos").fancybox({ 

===== SOLVED =====

I had to change

$(document).ready(function() {$("a.videos").fancybox({

to

$(document).ready(function() {
_$('a.video').live('mouseenter', function(){_
$(this).fancybox({
  • 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-23T11:59:56+00:00Added an answer on May 23, 2026 at 11:59 am

    Right after you changed your elements with javascript (for example, when you did .innerHTML = "") you have to call your initial code again, including the call to your fancybox plugin,

    You could also try to use .live() instead of .bind().

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

Sidebar

Related Questions

Hello everyone and thank you for your time. I would just like to say
Hello everyone and as usual, thank you to anyone taking the time to read
Hello everyone and thank you for your answers and comments. I have a table
hello everyone I am trying to make a script that steps through a list
THIS PROBLEM IS NOW SOLVED. THANK YOU TO EVERYONE WHO REPLIED. Hello, I am
Hello Everyone, I am developing an app which have to show all the restaurants
Hello Everyone, I have made so many Flash presentations, but every time i stuck
Hello everyone i am developing an quiz based app in android and i have
Hello good morning everyone, I am developing an iphone app which provide push notification
hello everyone I'm trying to write function which can unfold int in the list

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.