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 7504935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:44:21+00:00 2026-05-29T21:44:21+00:00

i’m using jquery to place video with flowplayer skin in a hidden div in

  • 0

i’m using jquery to place video with flowplayer skin in a hidden div in my page to make it play in fancybox

$("a.videoLink").click(function(){
    var videoFile = "products_video/" + $(this).attr("videofile");
    var videoPoster = $(this).attr("videofile");
var videoCode = '<a href='+videoFile+' id="player" style="display:block;width:600px;height:400px;"></a><script language="JavaScript">flowplayer("player", "flowplayer-3.2.7.swf")</script>';
    $("#videoPlayer").html(videoCode);
    $.fancybox({
        'transitionIn' : 'fade',
        'transitionOut' : 'fade',
        'href' : '#videoPlayer'
        });
    });

this is the hidden div

<div style="display: none;">
<div id="videoPlayer"></div>
</div>

when i click any of the images of the video it starts playing in fancybox but the problem is when i close the fancybox video starts playing from the beginning in the hidden div
how to stop the video if the fancybox is closed?

  • 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-29T21:44:24+00:00Added an answer on May 29, 2026 at 9:44 pm

    Because the API options in your script, I assume you are using fnacybox v1.3.x, aren’t you?

    What is happening here is that fancybox moves the inline content into the fancybox container and leaves a temp container inside the hidden DIV instead. Then your video starts playing inside the modal box.

    When you close fancybox, it removes the temp container and moves back the content from the fancybox container into the inline hidden DIV, so your video starts playing again there (as it did when it was moved into fancybox).

    As a workaround, try adding these two options to your fancybox script:

    'onClosed': function() {
     $("#videoPlayer").empty();
    },
    'onCleanup': function() {
     var myContent = this.href;
     $(myContent).unwrap();
    }
    

    The first option removes the video from the hidden inline content (so no more video in the background) and the second option fixes a bug described here when working with inline content.

    So the part of the fancybox script should look like:

    // videoCode script here etc
    $.fancybox({
     'transitionIn' : 'fade',
     'transitionOut' : 'fade',
     'href' : '#videoPlayer',
     'onClosed': function() {
      $("#videoPlayer").empty();
     },
     'onCleanup': function() {
      var myContent = this.href;
      $(myContent).unwrap();
     } 
    }); // fancybox
    // close click and ready etc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

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
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
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
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 want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build

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.