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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:52:54+00:00 2026-05-23T10:52:54+00:00

jQuery <script type=text/javascript> jQuery(document).ready(function () { jQuery(a.fancybox_videojs).click(function(e) { e.preventDefault(); var url = jQuery(this).attr(‘title’); var

  • 0

jQuery

  <script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery("a.fancybox_videojs").click(function(e) {
            e.preventDefault();

            var url = jQuery(this).attr('title');
            var rel = jQuery(this).attr('rel');
            var img = jQuery(this).children('img').attr('src');

            jQuery(this).fancybox({
                'overlayOpacity' : <?php echo get_option('fancybox_overlayOpacity'); ?>,
                'overlayColor' : '<?php echo get_option('fancybox_overlayColor'); ?>',
                'hideOnContentClick' : false,
                'content': '<div><div class="video-js-box vim-css">' +
                              '<video id="example_video_1" class="video-js" width="650" height="370" controls="controls" preload="auto" poster="' + img + '">' +
                              [...omitted...]
                              '</video>' +
                              '</div></div>',
                'titleShow' : false,
                'onComplete': function () { 
                    jQuery("#fancybox-inner").css({ 'overflow': 'hidden' });
                    VideoJS.setupAllWhenReady();
                },
                'onClosed': function () { jQuery("#fancybox-inner").empty(); }
            });
        });
    });
  </script> 

HTML

<div class="content-wrap container_12">
  <div class="work_cat alpha">
    <a href="" id="##"></a>
  </div>
  <div class="work_col">
    <div class="work_cell" id="thumb_##">
      <a class="fancbox_videojs" href="" title="" rel=""><img src=""></a>
      <a class="fancbox_videojs" href="" title="" rel=""></a>
    </div>
  </div>
  <div class="work_col"></div>
  <div class="work_col omega"></div>
</div>

I have two problems here.

  1. It takes two clicks to bring up the fancybox.
  2. I want the link in .work_cat to also bring up the fancybox, but it has to get the variables from the coresponding .work_cell

I omitted part of the jQuery code so it would not be too long. If you need to see it, I will post it up

  • 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-23T10:52:54+00:00Added an answer on May 23, 2026 at 10:52 am

    fancybox works on click.

    Try this instead (attach fancybox to all the places you want it):

      jQuery("a.fancybox_videojs").click(function(){return false;})
        .each(function(i,item) {
            var url = jQuery(this).attr('title');
            var rel = jQuery(this).attr('rel');
            var img = jQuery(this).children('img').attr('src');
    
            jQuery(this).fancybox({
                'overlayOpacity' : <?php echo get_option('fancybox_overlayOpacity'); ?>,
                'overlayColor' : '<?php echo get_option('fancybox_overlayColor'); ?>',
                'hideOnContentClick' : false,
                'content': '<div><div class="video-js-box vim-css">' +
                              '<video id="example_video_1" class="video-js" width="650" height="370" controls="controls" preload="auto" poster="' + img + '">' +
                              [...omitted...]
                              '</video>' +
                              '</div></div>',
                'titleShow' : false,
                'onComplete': function () { 
                    jQuery("#fancybox-inner").css({ 'overflow': 'hidden' });
                    VideoJS.setupAllWhenReady();
                },
                'onClosed': function () { jQuery("#fancybox-inner").empty(); }
            });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to load in content: <script type=text/javascript> jQuery.noConflict(); jQuery(document).ready(function(){ jQuery('.content-div').load(all-events.html);
I am generating events on fullCalendar with this code <script type=text/javascript> $(document).ready(function() { $('#calendar').fullCalendar({
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
How I can load the Google maps like this: function loadScript() { var script
<!DOCTYPE html> <html lang=en> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js type=text/javascript></script> <script type=text/javascript>
I have this jquery script which suppose to hide/show div element base on the
I'm currently working on a jQuery script that will translate the site's text into
I'm attempting to select all <script type=text/html> tags in a page. I use <script>
This is my Default.aspx + jQuery Script: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
Debugging one of my projects I noticed another developer had changed the $(document).ready() function

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.