Elegant trinket

Recently, I attempted to showcase a flash file and an image using Fancybox.

If you want to visualize what I am referring to, please refer to the screenshot below:

Objectives:

  • Automatically load Fancybox on page load with both the .swf file and the .jpg file
  • Center the .swf file similar to the example above
  • Position the .jpg file in the bottom right corner of the screen/page

I was able to achieve partial success.

To accomplish this, I first created a hidden link:

<a href="media/test_video.swf" id="flash-video" style="display:none"></a>

Then, I invoked it using a jQuery command:

<script type="text/javascript">$(document).ready(function() {
    $("#flash-video").fancybox(
    {
        'padding'               : 0,
        'autoScale'             : false,
        'padding'               : 0, 
        'margin'                : 0, 
        'easingIn'              : 'swing',
        'easingOut'             : 'swing',
        'transitionIn'          : 'fade',
        'transitionOut'         : 'fade',
        'hideOnContentClick'    : true,
        'speedIn'               : 600,
        'speedOut'              : 200,
        'overlayShow'           : true
    }
    ).trigger('click');
});

Additionally, I created a hidden link for the image, but unfortunately, it doesn't display on the Fancybox overlay.

<a href="media/bottom-r-img.jpg" id="flash-video" style="position:absolute;right:5px;bottom:5px;"></a>

Is it possible to show two media files simultaneously on a Fancybox overlay?

Any positive feedback is greatly appreciated :)

Thank you.

Answer №1

It's important to avoid having duplicate IDs in your HTML code, as this can cause issues. Additionally, keep in mind that fancybox is only capable of displaying one item at a time.

To address this, consider hiding your flash and image content inline and utilizing the inline loader. Alternatively, you can load the content from a separate URL using the iframe loader.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Looking to apply CSS selectors with variables to target all TD elements within a specific table?

Looking to apply CSS properties to all td IDs for rows in a table? Instead of individually targeting each ID like this: .idName1, idName2, idName3, idName4, idName5 {background-color: ##4CAF50;} You can simplify the process by using a PHP variable to ind ...

Striking a balance between innovation and backward compatibility in the realm of Web Design/Development

Creating websites is my passion, and I enjoy optimizing them for various platforms, devices, and browsers. However, lately, I've been feeling frustrated. I'm tired of facing limitations in implementing my creative ideas due to outdated technolog ...

Testing the screen size automatically using Javascript

Hello everyone, I've implemented a JavaScript code that triggers an image to slowly appear and darken the background when a link is clicked. However, on an iPad, the background doesn't completely turn black as intended. The CSS specifies that the ...

Adjusting the color of text based on the fulfillment of a condition

Is there a way to change the text color of a variable based on its value in PHP? For example, if the $status is set to admin, can we display it in red when echoed out using <h3>Status: <?php echo $status; ?></h3>? I'm not quite sure ...

Exposure to vulnerabilities in react-scripts

While working on my ReactJS app, I encountered a challenge related to vulnerability and security issues. The use of react-scripts library has highlighted numerous vulnerabilities in the latest version. Is it possible for me to directly update the depende ...

I am facing an issue with updating the state dynamically within a useState object

Within my useState, there is an object containing a variety of values. I have an input field and am dynamically setting its value to useState[key], which works fine. However, the issue arises when I try to update these values. When I call onChange and use ...

Automatically storing modified text from richtextbox into the database for safekeeping

I have developed a basic note-taking application using jquery and php. Currently, when the user clicks the save button, it sends an ajax request with all the data to update it in the mysql database. Everything is functioning correctly. However, I now want ...

Utilizing an Office App Ajax that includes an authentication header, the application connects to a secure Web API 2 backend with CORS

I am currently in the process of developing a content panel application for Office. As part of this project, I need to authenticate an account against a server. To accomplish this, I have implemented my own AuthorizationFilterAttribute on my web api 2 con ...

The reactivity of vuex state seems to be lacking

Implementing a loading spinner condition using Vuex to manage loading = true/false across multiple components. LoadingSpinner.vue <template> <fulfilling-square-spinner v-show="loading" class="loading-spinner" :animation-duration="4 ...

Guide to setting up Date Range Validator within MVC 4

Is there a way to limit the user from inputting a date outside of a specific range in my MVC 4 application? I'd appreciate any advice on how to achieve this. ...

Issuing a straightforward GET request results in a significant delay in receiving a response

I have a simple app running on Node.js, Handlebars, and Express. The main page features a single button that triggers an asynchronous GET request when clicked, causing a console.log message to display. Initially, the first click on the Submit button shows ...

Converting JSON to JavaScript Date using UTC time

I am struggling with formatting the dates in a JSON object to work with highcharts. The JSON looks like this: [ [ "26-Sep-14", 10 ], [ "29-Sep-14", 75 ] ] Highcharts requires dates to be in the format Date. ...

"Error: Unable to locate CSS background image file: net::ERR_FILE_NOT_FOUND

I currently have a background image set for the bottom of the header as shown below: header { background:url(../img/header_bg.png) #ea6225 no-repeat; background-size: 100% auto; background-position:left bottom; } The images are located in a folder ...

Accessing nested objects within a JavaScript array for an Express API

My current data sample looks like this: var data = [{ articles : [{ id : '0', url : 'foo', title : 'Foo', body : 'some foo bar', category : 'foo', tags : ...

Dealing with file downloads while using JWT-based authentication protocols

Currently, I am developing a web application using Angular that utilizes a JWT token for authentication. This means that every request must contain an "Authentication" header with all the required information. While this method works well for REST calls, ...

Using jQuery to dynamically disable a textbox when a checkbox is checked

I'm trying to implement a functionality where a textbox becomes disabled and changes its background color when a user unchecks a checkbox. Conversely, if the user checks the checkbox, the textbox should become editable and change its background color ...

Is it possible to utilize `const` in place of `let` universally?

When utilizing flowtype, our preference is to use const over let I have a function that needs to be executed with optimal performance, and it effectively compares two arrays with ids. This serves as a great example for my question: /** * @function compar ...

Retrieve the information associated with the selected entry in d3.js

When utilizing d3, the selection returned by *.enter() is unique in that it merely serves as a placeholder for upcoming elements. Unfortunately, this means that extracting data related to entering elements using *.data() (as with *.exit().data()) is not fe ...

Exploring CSS shaders in a browser?

Which browser out there fully supports CSS shaders? ...

Listen for incoming data from the client in the form of an ArrayBuffer

I have been utilizing the ws library within nodejs to develop a small cursor lobby where players can interact. I have managed to utilize the server to send ArrayBuffers with bit streams to the client and successfully decode them. However, I am encountering ...