The pop-up orientation is not being adjusted according to my CSS when it changes

I am currently working with Cordova 3.1.0 and Android 17.

Here is the HTML code for my pop-up:


    <div id="rightNavPrpPopup1" data-role="popup" class="r-menu-dropdown">
        <div class="r-menu-triangle"></div>
        <a class="class-a" data-transition="slide">A</a>
        <a class="class-b" data-transition="slide">B</a>
        <a class="class-c" data-transition="slide">C</a>
        <a class= "class-d" data-transition="slide">D</a>
    </div>

And here is my CSS:


.r-menu-dropdown{
 margin: 30px 5px 0 0;
 border-bottom: none;
}
.r-menu-dropdown a{
 padding: 10px;
 display: block;
 color: #fff !important;
 text-decoration: none;
 border-bottom: 1px solid #666;
 background: #555;
}
.r-menu-dropdown a:hover, .r-main-menu-dropdown a:hover{
 background: #444;
 }
 .r-menu-triangle{
 width: 0px;
 height: 0px;
 border-style: solid;
 border-width: 0 7.5px 13px 7.5px;
 border-color: transparent transparent #555 transparent;
 position: absolute;
 right: -1px;
 top: -14px;
 }

The issue I am facing is that when I change the orientation of my device, the pop-up does not align properly according to the CSS. It always centers itself regardless of the orientation, even if I swap between them during the pop-up animation.

Can someone please help me resolve this issue? Thank you in advance!

Answer №1

Ensure to define either an absolute or fixed position for .dropdown-menu

.dropdown-menu{
     position:absolute;
     left: 20px; // adjust based on your needs
     top: 50px;
     border-bottom: none;
}

Your decision between absolute and fixed will determine if the menu stays in place when scrolling.

Answer №2

Whenever the browser changes orientation, make sure to trigger a repaint by adding the following styles to your CSS:

html, body {

width: 100%;

min-width: 100%;

height: 100%;

min-height: 100%;

}

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

various image proportions in HTML

I have an image with a ratio of 16:9 that I want to use on my website. On one of the pages, I display a list of products with images having a ratio of 340x265. When a user clicks on an item in the list, it takes them to the product page where the same im ...

Exploring AngularJS capabilities: Retrieving data and headers from an HttpResponse

Currently, I have a REST API developed using Spring Boot. In the frontend, AngularJS 1.5 is being used. The login service not only sends data but also includes a header. I am wondering how I can effectively read both the data and header on the AngularJS ...

Styling definition lists and background containers with CSS

Currently, I am attempting to enclose a series of elements within a box and showcase some text beneath it: <div class="ft_models"> <dl> <dt>Models:</dt> <dd> <div>Item 1</div> ...

Despite following all the correct steps, the tailwind CLI remains unresponsive. Additionally, the default button fails to display any content

view the document and my packages (image) Although it worked with the cdn, I'm puzzled why I can't use it properly with the cli ...

Is it possible to change individual pixels within a canvas without the need to duplicate the entire buffer?

Is it possible to directly alter individual pixels within a canvas, rather than retrieving the entire buffer using ctx.getImageData and then pasting it back with ctx.putImageData? This is crucial in order to avoid the costly process of copying data every ...

Create an array of arrays within a loop using TypeScript

My application contains an object with dates and corresponding time arrays. The console log output is displayed below: 32: { 1514160000: Array [ 1200, 1500 ], 1514764800: Array [ 1200, 1500 ], 1515369600: Array [ 1200, 1500 ], 1515974400: Array [ 700, 12 ...

Is there a way to inject C++ text into an input field on a webpage using QWebEngine?

I want to integrate a website with QWebEngine to manipulate input commands using Qt's event filters and more. The specific website I am working with requires a username/email and password, and I aim to manage the input of this text on my end. This inv ...

What is the reason for the lack of data being displayed when using console.log() with a map object?

I currently have pet information stored in a MongoDB object like so: { "_id" : ObjectId("0000439359317900131f111"), "name" : "Travis", "description" : "Travis is a support animal", ...

Replicate the array multiple times and combine them into a single flat array

I have a four-element array that I need to copy to another array four times. I achieved this by concatenating the array four times. Here is what I tried: let demoProperties = [] .concat(fourDemoProperties) .concat(fourDemoProperties) .concat(fourDe ...

What is the reason for the presence of the ^ symbol in this drop-down menu?

Just came across a great script, check it out here! Noticed the drop down has a ^ on top. The CSS I found for this is as follows: #colorNav li ul li:first-child:before{ content:none; position:absolute; width:1px; height:1px; border:5 ...

The password encryption method with "bcrypt" gives an undefined result

import bcrypt from 'bcrypt'; export default class Hash { static hashPassword (password: any): string { let hashedPassword: string; bcrypt.hash(password, 10, function(err, hash) { if (err) console.log(err); else { ha ...

Element was removed upon clicking only once

Can anyone help me figure out why the behavior of .remove() with $postNav.remove(); is different here? When you click on "I'm a tag" for the first time, both the <li> and <ol> are deleted as expected. However, on the second click, only the ...

The proper method for converting an AxiosPromise to a standard Promise without falling into the promise constructor anti pattern

Here is a TypeScript function example: public load(filter: IFilter): Promise<Material[]> { return axios.get<Material[]>("data.json"); } When using TypeScript, an error may occur due to incompatible types: [ts] Type 'AxiosPromise< ...

Top method for transferring data between React components post retrieval from Axios Call

I am currently utilizing React JS in an application structured like the following diagram: This particular application fetches data from a Rest API (Node express) using Axios. The challenge I am facing is determining the most effective method for storing ...

Guide for setting up a React infinite scroll feature in a messaging app similar to Facebook Messenger

I have been exploring various questions regarding React infinite scroll, but I am looking to delve deeper in order to discover the most effective solution available for implementing such a component. Currently, I am working on a chat application and have ...

Developing desktop applications using C# scripting

I currently have a C# desktop program that is able to work with new C# plugins. My goal is to modify the existing C# application to allow for scripts to be used as plugins. These scripts could be in JavaScript, Windows Script Host (WSh), or any other form ...

The best approach to incorporating interactive animation in next.js

My vision is to develop a character creation application using next js. The app should empower users to customize the character using sliders and gender selection buttons. The ultimate goal is to have a 2D animated version of the character that dynamicall ...

Scrolling map based on tiles

This specific script is responsible for rendering the map as well as other elements: public void render(Canvas canvas) { canvas.drawColor(Color.TRANSPARENT); Drawable myImage; int tileWidth = 50; int tileHeight = 50; ...

Objects in Three.js Sparkling from Afar

Currently, I am tackling a project that involves working with scenes containing objects ranging from 10 to 1000000 in size. A recurring issue I have encountered is that when dealing with the larger end of this size spectrum, the objects seem to 'shimm ...

Combine Vue Plugin Styles without Using Components

Question Time To clarify, when I mention 'without component', I am referring to my plugin being a custom Vue Directive that does not rely on a template. It acts as a wrapper for a class, without the need for an additional component. However, I a ...