Manipulate CSS styles in jQuery Mobile

My issue arises when trying to implement this design in JQuery Mobile:

The problem I'm facing is that initially the page appears as desired, but then JQuery Mobile changes it all to gray.

I am wondering how I can make JQuery Mobile not affect certain parts of the page?

I have searched extensively on this topic and came across suggestions for using Themeroller, however, I cannot figure out how to apply those styles in this case.

I also attempted using data-role="none," but it seems to only work on form elements.

EDIT:

Below is the code snippet:

<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.6..min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    <link rel="stylesheet" href="http://www.rwe-uk.com/static/ichat_with_css3/style_5.css" />
  </head>
  <body>
    <div data-role="page">
      <div class="commentArea">
        <div class="bubbledLeft">
          Hi
        </div>
        <div class="bubbledRight">
          Hi there yourself
        </div>
      </div>
    </div>
  </body>
</html>

Removing the jQuery Mobile script line allows the design to display correctly.

Answer №1

To change the appearance of the page, you have a couple of options:

<div data-role="page" style ="background: transparent;">

You could also create a custom class for this purpose:

.ui-content-transparent{
    background: transparent !important;
}

--

<div data-role="page" class="ui-content-transparent">

Check out this Example

Answer №2

To achieve this, I follow a specific order when loading the CSS:

  1. Start with the theme file from themeroller
  2. Then add the jquery.mobile.structure-1.0.min.css
  3. Include my common overriding style
  4. Finally, add platform-specific overriding styles like android.css or ios.css

The order of loading stylesheets is crucial for proper styling.

When overriding styles in stylesheet 3 or 4, sometimes !important is necessary.

Ensure that you target the final DOM layout with your overriding styles.

I hope these tips are helpful.

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

Achieve vertical alignment of a div alongside an image without utilizing tables or flexbox

As a beginner, I know this question has been asked numerous times, but I am struggling to find a straightforward answer that makes sense to me. I prefer not to use tables or flexbox, just plain CSS. What I Need: I have an image and I want to vertically c ...

Create a semicircle progress bar with rounded edges and a shadow using JavaScript and CSS

Despite my extensive search efforts, I have been unable to find a solution. My goal is to create a progress bar with rounded corners that includes a shadow. So far, this is what I have managed: $(".progress-bar").each(function(){ var bar = $(this). ...

Retrieve the HTML content of all children except for a specific child element in jQuery

Is there a way to utilize jQuery/Javascript for selecting the HTML content of the two <p> elements in the initial <div class="description? I'm open to using Regex as well. This specific jQuery selection is being executed within Node.js on a c ...

Exploring a variety of order types within AngularJS

In my table, I have a list of employees with various information. Initially, when the table loads, all the employees are sorted by their Status using a custom order function in my controller. Employee.html <table class="table"> <thead class= ...

Struggling to retrieve the JSON information, but encountering no success

Here is the javascript code snippet: $.getJSON("validate_login.php", {username:$("#username").val(), password:$("#password").val()}, function(data){ alert("result: " + data.result); }); And here is the corresponding php code: <?ph ...

Currently, I am experimenting with creating interactive tabs by utilizing jQuery

Does anyone have suggestions on how to create clickable tags using JavaScript without causing everything to disappear when clicking on the tabs? Here is the HTML code: <div id="contentwrap" class="round"> <h1>About Eclipse</h1> ...

Placeholder fails to appear

After implementing some jQuery validation, I wanted to display a text as a placeholder when the user skipped out of an input field without entering anything. This is the code I wrote: $('input[type="text"]').on('blur', function() { ...

Activate and focus on the text input field with a checkbox using AngularJS

Currently, I have a Bootstrap 3 input field with some prepended content along with a checkbox. My goal is to have the input field disabled until the checkbox is checked, and when it is checked, I not only want to enable the field but also set the focus on ...

"Uploading" a picture using jQuery

I have been using this particular code snippet to display messages. setTimeout(function(){ o.html(o.html() + "Username:<br>" + msg[r] + "<br><hr>") }, 7000); It's effective in posting messages from an array and adding some st ...

Click X button to toggle and close the dropdown menu

After successfully creating a responsive menu that toggles with a hamburger icon at 1205px resolution, I encountered an issue. Once the hamburger icon is clicked and the dropdown menu opens, there seems to be no way to close it. I am looking to add an X bu ...

Leveraging AJAX for fetching data from a deeply nested JSON structure

My AJAX request is functioning properly: $.ajax ({ url: 'api.php', type: 'GET', data: {search_term: data}, dataType: 'JSON', success: function(data) { $('#div').html('<p>Consti ...

Is it possible to invoke 2 separate functions using jQuery ajax?

I'm working on an ASP.NET page that has an HTML button. Clicking on this button triggers a jQuery function to display a moving GIF progress bar within a <div>. While the progress bar is visible, I also need to call another web method to load a s ...

Adding a Row to an HTML Table Inside a Form through JavaScript

I'm currently attempting to insert a row into a table that resides within a form using JavaScript. The strange thing is, the code functions perfectly when it's placed outside of the form tags. However, as soon as I enclose the code within the for ...

What is the best way to extract a specific section of a URL using both jQuery and JavaScript?

As I navigate through an order in WordPress using jQuery AJAX, a response is returned by WordPress after a successful post. This response contains a success value and a url value. I am aiming to extract a specific section of the url to utilize the id as a ...

The smoothness of jQuery animations is not consistent

I've been working on mastering the art of scheduling animations using JavaScript, in particular with the assistance of jQuery. In an attempt to create a blinking effect for some h1 tags, I noticed that the animation was not running smoothly. It would ...

Steps to verify the timepicker for accuracy and consistency throughout different time periods

I am currently working on validating a time picker for a project. I found a helpful example for date validation at http://jqueryui.com/resources/demos/datepicker/date-range.html but I need to adapt it for a time picker. Specifically, I need to ensure tha ...

The CSS file is causing the footer to be cut off from the page and

My webpage is not scrolling properly when I add a lot of content, causing the footer to get cut off. I have tried various solutions found in other questions, but none have worked for me. Can anyone offer any suggestions or advice to fix this issue? html ...

How can I determine the remaining amount of scroll left in my HTML document?

Is there a method to determine how many pixels of scroll remain on the page when the scrollbar is set at a specific position? I am currently utilizing jQuery's scrollLeft feature, which can be found here: http://api.jquery.com/scrollLeft/. I want to ...

I find myself having to double-click the Jquery submit button

Can anyone help with an issue I'm having where I need to click a div button twice for the link to work properly? Thank you <div class="toolbar"> <table width="100%"> <tr> <td class="toolbar-button" title="Print Data" id ...

Utilize PHP in an APP Engine Application to send an email to a Gmail address

I have a project deployed on Google App Engine where I need to send an email once a user submits the contact form. My app is successfully deployed and I have implemented an ajax request to a PHP file, but unfortunately, it's not functioning as expect ...