.css() function was not utilized, resulting in the <div> element not being revised

Enhanced Functionality:

To elevate user experience, I have implemented a feature where clicking on the video will toggle it to full-screen mode and then revert back to its original size upon another click. The initial video container's CSS style is defined as follows:

<div id="Journal_Video" style="position:absolute; left: 120px; top: 180px;" class="jp-video jp-video-750p" role="application" aria-label="media player"></div>
.

Successful Implementation:

I have successfully programmed the video to expand and restore to its original dimensions.

Below is the code snippet for your reference:

<script>
//Journal Video
$("#Journal_Video").jPlayer({
ready: function() {
var self = this;
var fullScreen = $(self).jPlayer("option", "fullScreen");

$(this).jPlayer("setMedia", {
  m4v: "https://www.youtube.com/embed/YE7VzlLtp-4"
}).jPlayer("play");
$(".jp-jplayer video").click(function() {

  if (fullScreen = !fullScreen) {
    $("#Journal_Video").css({
      "top": "0",
      "left": "0"
    });
    $(self).jPlayer("option", {
      "fullScreen": fullScreen
    });
  } else if (fullScreen == fullScreen) {
    $(self).jPlayer("option", {
      "fullScreen": false
    });
    $("#Journal_Video").css({
      "top": "180",
      "left": "120"
    });
  }

  });
   },
  swfPath: "javascript",
  supplied: "webmv, ogv, m4v",
  loop: true,
  useStateClassSkin: true,
  autoBlur: false,
  smoothPlayBar: true,
  keyEnabled: true,
  sizeFull: {
    top: 0,
    cssClass: "jp-video-750p",
  },
  size: {
    width: 1200,
    height: 750
  }
  });
  $("#Journal_Video").show();
  </script>

  <div id="Journal_Video" style="position:absolute; left: 120px; top: 180px;" class="jp-video jp-video-750p" role="application" aria-label="media player"></div>

Potential Issue:

The CSS styling adjustment at

else if (fullScreen == fullScreen) {...}
:

$("#Journal_Video").css({
  "top": "180",
  "left": "120"
});

does not seem to execute when the full-screen video is reverted back to its original state by the user.

This baffling discrepancy has me seeking assistance with resolving this matter.

Answer â„–1

modification

otherwise if (fullScreen == fullScreen)

turning into

otherwise if (fullScreen == fullScreen)

Answer â„–2

It appears that the fullScreen value is being set to false in (fullScreen = !fullScreen), causing the else if conditional to never evaluate as true. Could it be corrected to (fullScreen !== fullScreen)?

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

Firefoxx unable to communicate with server through ajax requests

My dilemma involves transmitting data to my server using the json data type with ajax. Oddly enough, in Firefox the server fails to receive any data at all, while in Chrome and IE the data is successfully transmitted and displayed on the server console. H ...

Adding an id attribute to your HTML <tr> element can make it more

Is there a way to assign a unique ID (such as 1, 2, 3, etc.) to each new row generated by my script? FIDDLE CODE: function deleteRow(tableID) { try { var table = document.getElementById(tableID); var rowCount = table.rows.length; ...

Can someone help me identify the table rows that are adjacent to a dropped row in a jQueryUI Sortable setup?

My current setup involves using the jQueryUI Sortable plugin on a table, and thankfully everything appears to be functioning correctly. Both the HTML and JavaScript are passing validation. However, I am faced with the challenge of finding a way to identi ...

Adjusting the size of content tags depending on their popularity

Currently, I am working on setting up a basic tagging system by following the database structure provided in this Stack Overflow post. My goal is to create a single page that showcases all the tags, with each tag being visually scaled based on its popular ...

Tips for creating an input field that automatically expands and has a specific width

I am facing an issue with the alignment of my search field. Here is the code snippet: #menu_search{ position: absolute; width: 100%; max-width: 1280px; display: inline; float: right; right: 0px; z-index: 99; } I would like th ...

Center alignment is not possible for the Div element

Problem Every time I attempt to implement the following code (outlined below), the div only appears centered when using width: 100px;. <div style="border: solid 1px black; width: 100px; height: 100px; background-color: blue; margin-left: auto; mar ...

Having trouble with submitting the code - need help resolving the issue

I'm facing an issue with my submit cancel code. The JavaScript code I implemented for preventing the submission function on my page isn't working as expected. While it does work to a certain extent, it's not fully functional. I am seeking a ...

Extracting information from JSON using jQuery

this is a sample json object: { "box 1": [{ "difficulty_grade": "5a+" }, { "gym": "New_gym" }, { "route_author": "some author" },]} https://i.sstatic.net/UJodJ.png Here is the code snippet: variable groups contains JSON data as shown in the ...

"The alert() function in Javascript takes precedence over the code that came before it

When I have a contact form with a submit button, my goal is to use JQuery to change the button text to "Send" and display the received response in an alert, once a response is received from the server-side PHP processing the submitted data. Change button ...

The settings for Owl Carousel are failing to load

Check out my live demo here. I've integrated an owl carousel at the bottom of the page. Here is the JavaScript code snippet I'm using to configure the carousel: $('#owl-partners').owlCarousel({ margin: 20, dots: false, ...

Experiencing an "Unsupported media type-415" error when making an ajax call using Jquery and ajax technology

When I try to update a specific record using an ajax function, I keep receiving a 415-Unsupported Media type error. Below is the JavaScript code I am using: $("#update").on("click", function(){ event.preventDefault(); return $.ajax('/upda ...

Prevent automatic page refreshing with jQuery when changing SELECT options

I have come into possession of a poorly coded website that utilizes jQuery v2.1.3. One issue I've encountered is with a select dropdown list on a page which triggers a page refresh whenever the selection is changed. Upon inspecting the Chrome develop ...

Styling columns with full height using CSS Flexbox

I'm currently experimenting with Flexbox to design a basic two-column webpage that stretches across the entire width and height. The left column has a fixed width of 200px, while the right column uses up the rest of the space. Here's what I have ...

Steps for mocking an async action creator in Redux using Jest

I am currently working on writing a unit test for a redux async action creator using jest. asyncActions.js: const startSignInRequest = () => ({ type: START_SIGNIN_REQUEST }); // this is the action creator for successfully signing in a user export c ...

JavaScript - Modifying Text within a Dropdown Menu

I'm currently working with a code that generates a dropdown menu/selector. Upon selecting an option, the main display should change accordingly. While I can't directly modify the code, I have the ability to use JQuery to alter the displayed text. ...

Add a Filter to the Observer (__ob__) in Typescript

I am trying to implement a filter using this.Grid.option("dataSource").filter(x => x.Placeholder != null) however, it doesn't seem to be working when I run console.log(this.Grid.option("dataSource")); I receive (72) [{…}, {…}, {…}, {†...

What is the best way to transfer values from a nested child component up to the parent component

In my component hierarchy, there is a parent component with a child component that further contains another child component. Parent |-Child One (child of parent) |-Child Two (child of Child One) Currently, I am passing a value from Child Two to Child On ...

Looking to implement pyperclip functionality on Heroku platform

Is it feasible to utilize pyperclip on Heroku with a Selenium application in order to copy something to the clipboard? Since the platform utilizes a 'headless' browser and lacks a GUI, accessing the clipboard is challenging. Is there any way for ...

Setting the maximum width for images across various Bootstrap responsive sizes: a step-by-step guide

I'm struggling with optimizing images of varying sizes in bootstrap to ensure they are responsive without losing quality. Current Image: https://i.sstatic.net/akoNy.jpg Desired Image: https://i.sstatic.net/37VFX.jpg HTML: <div class="row"> ...

I could see the Javascript and CSS code manifesting directly onto my HTML page

I've encountered a strange issue with my calendar code where my JavaScript and CSS codes are inexplicably showing up next to the calendar. Does anyone have any insights into why this may be happening? I developed the code in an online HTML/CSS/JS edit ...