What is the best way to increase the size of this circle so that it completely fills the screen

Currently working on a project involving HTML and CSS, I am faced with the challenge of expanding a circle to fill the entire screen. The unique structure of the design requires the circle to be positioned in a specific location as it is an integral part of the logo.

Here is what I envision for the final result:

http://jsfiddle.net/frapporti/85qfu/
Code

However, this is the current state of the project:

https://jsfiddle.net/IaZoro/ou9vwovr/
Code

The objective is to have the red dot expand to cover the entire screen, overlayed with a CSS slideshow, with an "x" button at the top right corner to close or hide everything.

If possible, I would prefer to achieve this effect using only CSS, but I am open to incorporating Javascript/jQuery if necessary. Any assistance provided would be greatly appreciated. Thank you!

EDIT: I discovered that the issue with my JavaScript code was due to using jQuery instead of Zepto.js as utilized in the referenced demo above.

Although still encountering difficulties, I thought it was important to mention this development.

Answer №1

It seems like I have grasped your request correctly. Allow me to present a clear solution for you:

Here is the HTML structure:

<body>
    <div id="main-wrapper">
        <div id="inner-wrapper">
            <div id="close-box"></div>
            <div id="slideshow-wrapper">
                <img class="shown" src="http://i.imgur.com/XeBydh2.png" />        
                <img src="http://i.imgur.com/xy1Aqbn.jpg" />       
                <img src="http://i.imgur.com/i7elQhu.jpg" />
            </div>
        </div>
    </div>
</body>

And here is the CSS styling:

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

img {
  max-width: 100%;
}

/* Additional CSS classes and styles are applied below */
#main-wrapper {
  background: red;
  border-radius: 50%;
  overflow: hidden;
  height: 100px;
  width: 100px;
  transition: all .5s;
  position: absolute;
  top: 50%;
  left: 50%;
}

#inner-wrapper {
  margin: 30px;
  border: 1px solid;
  position: relative;
  display: none;
}

#close-box {
  background-color: black;
  border: 2px solid white;
  position: absolute;
  top: -10px;
  right: -10px;
  height: 30px;
  width: 30px;
}

#slideshow-wrapper img {
  display: none;
}

#slideshow-wrapper img.shown {
  display: block;
}

#main-wrapper.shown {
  top: 0;
  left: 0;
  width: 100%; 
  /* Adjusted styles applied accordingly */
}

#main-wrapper.shown #inner-wrapper {
  display: block;
}

Lastly, we include some JavaScript functionality:

$(function() {
    $('#main-wrapper').click(function() {
        $(this).toggleClass( 'shown' ); 
    });
    
    $('#close-box').click(function(){
        $('#main-wrapper').removeClass('shown');
    });

    $('#inner-wrapper').click(function(e){
        e.stopPropagation(); 
    });

    $('#slideshow-wrapper').click(function(){
        var current = $(this).children('.shown');
        current.removeClass('shown'); 

        var next = current.next();
        if(next.length < 1) 
            next = $(this).children().eq(0);
        next.addClass('shown'); 
    });
});

Remember to ensure jQuery is properly loaded in your project!

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

What is the process for sending a post request in the inline editor of Dialogflow?

Currently, I am utilizing the blaze tier, so there should be no billing concerns. I have also added "request" : "*" in my package.json dependencies. Check out my code index.js below: ` 'use strict'; var global_request = require('requ ...

The consistent index is shared among all dynamically generated elements

I'm currently working on a project where I am generating dropdowns within a table dynamically. I am attempting to determine the index of the dropdown that triggered the event in the following way: $(".template").on('change', '.dataType ...

Jumping over loop iteration following a JavaScript catch block

Currently, I am developing an API that requires making repeated calls to another API (specifically, Quickbooks Online) within a loop. These calls are encapsulated in promises that either resolve or reject based on the response from Quickbooks. Everything f ...

Is it possible to authenticate a user in Firebase using Node.js without utilizing the client side?

Can I access Firebase client functions like signInWithEmailAndPassword in the Firebase SDK on the server side? Although SDKs are typically used for servers and clients use JavaScript, I need a non-JavaScript solution on the client side. I have set up the ...

jQuery causing issues with CORS configurations

The following code snippet is from a WCF RESTful Service: public EmployeeJSON GetEmployeeJSON(string id) { List<EmployeeJSON> employees = new List<EmployeeJSON>() { new EmployeeJSON() {Name="Sumanth",Id=101,Sal ...

What is the proper way to send parameters to the controller using $routeProvider?

I am new to Angular.js and I have a question about passing postId to the fullPostController. Currently, the fullPostController is fetching data based on the id using $http, but how do I actually pass the postId to the controller? 'use strict&apos ...

What is the best way to insert shapes in between pictures?

As a beginner in bootstrap, I am trying to create photo galleries for my sample website. I would like to incorporate the diamond shapes seen in the photo into the image gallery. I came across this source code: <div class="row"> < ...

Is there a way to retrieve the `this.$route` data while using vue-apollo?

Currently working on building a GraphQL query with vue-apollo and graphql-tag. When I manually set the ID, everything runs smoothly. However, I'm aiming to dynamically pass the current route's ID as a variable to Vue Apollo. Successful Implemen ...

Troubleshooting HTML image visibility issues

I've been trying to get a Tumblr icon to display in the upper-right corner of my HTML-based page, but all I see when I open it in a browser is a white box with a gray outline. The code I'm using for the image is: <img style="float: right; mar ...

Attaching an event handler to $(document) within an Angular directive

One of the challenges I am facing is creating a directive that functions like a select box. When this select box is open and I click outside of it (anywhere else on the document), I want it to collapse. Although this JQuery code works within my directive, ...

Issue: This error occurs when attempting to double click on the diagram or a node but the show function for c is not recognized

I've encountered an issue with my gojs diagram. When I double click on it to edit the node name, I receive an error message. This problem occurred after upgrading my gojs version from v1.7.14 to v2.2.17. Below is the error stack trace: core.mjs:8453 E ...

What is the best way to implement an onclick method on a div in order to toggle the display of information

I have come across similar questions, but in my case, I am working with dynamic data from an API. I want the message body to show when a user clicks on a message with only the subject, and then be able to click again to hide the body. The current functio ...

Generate a PDF file using a byte array and save it for download

I am working on an AJAX function that calls a server-side method which in turn calls an API and returns a byte array. My goal is to convert this byte array into a PDF file and then download the file. Here is the code I have: AJAX function: function Obtai ...

"Using an empty array before each statement in jQuery Ajax to handle JSON data

I have a script using jQuery that gathers data from multiple websites and then saves it into a SQL database through AJAX and PHP. Right now, the script saves each set of collected data from a site individually. I would like to modify this so that the scrip ...

Gravity Forms Dropdown Selections Aren't Visible

I recently made a modification to the footer.php file by adding the following code: <div class="footer-email-form-container"> <?php echo do_shortcode( '[gravityform id="26" title="true" description="false"]' ); ?></div> Howeve ...

Dealing with ETIMEDOUT error in Express.js

My Node.js/Express.js application interfaces with an FTP server, but crashes when the server is offline due to handling issues with the ETIMEDOUT exception. I am using the jsftp module for FTP. Here's the problematic part of my code: router.post("/" ...

Struggling to retrieve integer values from a JSON object array

I'm currently working on a function to iterate through an array of objects retrieved from the server. When I console.log the response, this is the structure I see. https://i.sstatic.net/ErOps.png This is the JavaScript function I've created for ...

What is the best way to select or deselect all asp.net checkboxes with just one checkbox event?

I am looking for a way to control the checkboxes on my webpage using a checkbox named Select All, allowing me to check or uncheck all checkboxes within individual div sections. Since my checkboxes are asp.net controls with runat=server, I am unsure how to ...

"Exploring the wonders of a jQuery plugin within the

Can anyone recommend a plugin for eclipse Luna that offers complete jQuery functionality? I've noticed that JSDT doesn't provide all the features. Thank you! ...

Unlock the potential of localstorage in dropdown toggle menus with jQuery and HTML

Do you have a moment? I need some help with using local storage in my dropdown toggle menu. Below is the HTML code that I am working with: <li class="nav-item" id="sidebar"> <a class="sidebar-heading" href="#thirdSubmenu" data-toggle="collaps ...