Increasing the size of the .ui-btn-left component

Seeking advice on a Javascript query that I can't seem to resolve online. As a beginner in Javascript, I'm struggling with what seems like a simple issue. My dilemma lies in enlarging the close button on a jQuery page.

.ui-dialog .ui-header .ui-btn-left {
    left: auto;
    right: 5px;
}

I understand that specifying height and width will increase the button's size, but how can I adjust the icon size to match or center it on the button?

Answer №1

After some trial and error, I managed to find a solution to my issue. The key was removing the default close button and creating a custom one instead. Hopefully, this information will benefit others facing a similar challenge. Using the data-close-btn attribute disables the default close button.

The data-icon attribute simply instructs it to utilize the custom icon, which is much simpler than I initially thought.

#btnCancel .ui-btn-inner {
    width: 33px;
    height: 35px;
    margin: 0px;
    border: none !important;
    background: transparent !important;
}

.ui-icon-custom 
{
   background-image: url(../images/image.png) !important;
   background-position: 0px -84px;
   width: 33px;
   height: 35px;
   margin: 0 !important;
   box-shadow:none;
} 

<html>
   <head>
    <title>Change Language</title>   
   </head>

   <body>

     <div data-role="page" id="changeLanguage" data-close-btn="none">
       <header data-role="header">
           <h1 data-translation-key="choose language" ></h1>
           <a id="btnCancel" class="ui-btn-left" data-icon="custom" data-rel="back" data-    iconpos="notext" ></a>
       </header>

       <div data-role="content">
         <p data-translation-key="pick language"></p>       
         <ul id="languageSelection"></ul>
       </div>

       <p class="version"></p>
     </div>
   </body>
</html>

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

Retrieving text from a draggable div using jQuery

I have a draggable div that I can move over another element with the class .outerDiv which contains text content. Is there a way for me to retrieve the text from .outerDiv that overlaps with the draggable div? $(".outerDiv .isStore").draggable({ contain ...

Retrieving HTML code as a variable using Python

I am attempting to output HTML code as a variable in my Python script, but it's not working properly. What could be causing this issue? Here is an example of my code: return render_template("dashboard.html", services = "<h1>Service 1</h1> ...

Place two divs within a parent div that can adjust its width dynamically

Within this lengthy div, there are 4 elements arranged as follows: icon (fixed width) item_name [needs to be accommodated] item_type [needs to be accommodated] item_date (fixed width) I am currently attempting to find a way to ensure that the it ...

Partially loading CSS stylesheet

My directory structure looks like this.... iamdan > css > style.css The php file, named head.php, is located in a folder called includes within: iamdan > includes > head.php This file contains the following code: <head> <title ...

Attempting to utilize a custom element, the message "You attempted to use polymer without loading it first" confirms that it has indeed been imported

I've been experimenting with a custom element for a paper-dialog popup that I want to incorporate. Surprisingly, when I create a test page within the same file where the custom element is defined, using all the identical imports as my main index, it w ...

One DataTable cell with a unique feature: two buttons of varying sizes

Currently, I am working with a DataTable that contains a column with two Bootstrap-styled buttons. Strangely, the button on the right appears slightly smaller than the one on the left. Picture illustrating the issue Here is the code snippet: <div cla ...

Display a scrollbar for the offspring of an element with a flex-grow value of 1

I'm seeking to create a straightforward design consisting of a layered header, main section, footer. My framework of choice is bootstrap 5. The complete layout should occupy all available width and height, with overflow (x and y) set to hidden. Hea ...

Upon the page loading, only select a handful of checkboxes (JSF)

I am currently developing a web application using JSF 2.0 and I need to have checkboxes pre-selected when the page loads. <h:selectManyCheckbox value="#{UserRegistration.rightSelected}" id="myRight"> <f:selectItem itemValue="add" itemLabel="A ...

Enhancing Online Presence with Video Gallery Website Development

I'm in the process of creating a website and need help finalizing my video page. I envision a layout similar to this example: https://i.stack.imgur.com/hctui.gif The main feature should be a large video placeholder at the top, followed by several thu ...

Error: The JSON input unexpectedly ended, however the PHP file itself is error-free

When trying to display data retrieved using PHP through JSON/Ajax, I encountered an error message: [object Object] | parsererror | SyntaxError: Unexpected end of JSON input The PHP script is functional (I can view the JSON output by directly accessing th ...

Enhance a DOM element using personalized functions in jQuery

Seeking advice on how to create custom widget placeholders with a "setvalue" function specific to each type of widget: $.fn.extend($(".dial"), { setval: function(val) { }); Attempting to avoid extending jQuery.fn directly since different widget type ...

Executing JQuery code and utilizing external libraries in Ionic (Angular JS) to power my hybrid application

Currently, I am in the process of developing an Ionic app for my website and incorporating all JQuery code along with external libraries such as Lightbox, Slider, etc. I was wondering if anyone could provide me with guidance (preferably with an example) o ...

Issue with CSS margin-top not displaying properly in Firefox and Internet Explorer, but working fine in Chrome and Opera

I'm encountering difficulties with the margins on my website. It seems like margin-top isn't functioning properly in Firefox and IE, even though it is working correctly in Chrome and Opera. Despite trying various techniques and searching online f ...

Guide to configuring capybara-webkit for testing ajax requests and capturing screenshots containing HTML with loaded CSS and JavaScript

Having some trouble setting up capybara-webkit on my Rails 4.2.1 app. Tests are running fine, links are being clicked, and ajax calls are working, but there's one odd issue with capybara-screenshot gem. I wanted to capture html screenshots with all as ...

Using jQuery's AJAX method: How to access a referenced element outside of a closure

Here is the code snippet I am using to make an ajax call: I am trying to figure out how I can access the target element. Declaring a target element does not seem to work, possibly because I am defining the function handler outside of the click event handl ...

No error message is displayed by Codeigniter Ajax when the data does not match any records in the database

I'm currently utilizing AJAX within CodeIgniter and facing an issue. Below is my code snippet. It functions properly when the SQL query retrieves results. However, if the query doesn't return anything, AJAX doesn't provide any output. This ...

Aligning enlarged text that spills over

Within my html/css application, I have defined a button as a class named .button with specific attributes. Here is a simplified example: .button { width: 120px; height: 30px; line-height: 30px; background: yellow; text-align: center; } <div ...

The act of resizing a window causes the text to be forcibly expelled from its containing div

When you hover over an image in a grid, text and a button appear. However, when the window is resized, the content ends up overflowing out of the div. This issue is part of my first project that I am working on during a bootcamp. I have decided to keep th ...

Having trouble with an AJAX request to display a template in Flask

Imagine having two radio buttons labeled 1 and 2, along with some text at the bottom of a webpage. Initially, the text value is set to -1 and no radio buttons are selected. If one of the radio buttons is clicked, the text value should change to either 1 or ...

Exploring the possibilities of device orientation in combination with 3D transforms

Imagine a project that aims to create a cube with sides representing different geolocations. The cube's sides for east, west, up, ground, north, and south are meant to always point in their respective directions. To gather the necessary data, the proj ...