Questions tagged [data-theme]

A data attribute added to HTML elements used by jQuery Mobile to indicate what theme to apply.

In jQuery Mobile you generally indicate how a page or container should be themed through the use of the data-theme attribute (in some cases there are slight variations such as data-content-theme that are used instead).

Links

Theming overview in official docs.

10 questions
9
votes
4 answers

Change data-theme in jQuery mobile

I'd like to provide my user some persistent feedback after they've pressed a button (like it's indented or something). I tried: $(this).data('theme','b'); But that doesn't work. Q: Is there a way to show an indented button, or change it's…
Phillip Senn
  • 46,771
  • 90
  • 257
  • 373
1
vote
1 answer

Inserting WordPress shortcode into JS through AJAX request

I am trying to insert WordPress shortcode into JS but haven't managed so far. I found some jQuery code that I needed to translate into vanilla JS and I am pretty sure I did not do the right thing since it's not working. I do not fully understand the…
1
vote
1 answer

jQuery Mobile: change/switch theme on listview data-split-icon

I have split listview (with collapsible set) in jQuery Mobile (jQm). You can see it here on JSfiddle. I want the split icon act as checkbox. The icon has default data-theme="c" so it is grey and I want to change the data-theme to b on click, so the…
Rudolf Gröhling
  • 4,611
  • 4
  • 27
  • 37
1
vote
1 answer

Elements no longer inherit data-theme from parent

According to the jQuery Mobile Docs any form element inside a container will adopt the data-theme of that container Query Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements…
Jack
  • 10,943
  • 13
  • 50
  • 65
1
vote
2 answers

Adding data-theme to all items

How can I add the data-theme value to all divs, listviews, forms, li, ul etc. from JavaScript? Is it possible? If yes how can I do that? Will something like the following work? $.mobile.page.prototype.options.contentTheme= "e";
Piotr Krysiak
  • 2,815
  • 3
  • 23
  • 35
0
votes
2 answers

how to make a theme switcher using the jQuery mobile's data-theme attribute

I want to make a theme switcher using the data-theme attribute of the jQuery mobile framework. When the user clicks a link which has a data-theme inside it, all my pages' data-theme attribute should be replaced with this clicked data-theme…
Eslam Hamdy
  • 7,126
  • 27
  • 105
  • 165
0
votes
2 answers

How to toggle data-theme value on click

So I have set up a light and dark theme using variables in css and I want my toggle to change the data theme from "light" to "dark" - how do I do this? JS $(document).ready("#toggle_checkbox").click(function() { $('body').attr('data-theme',…
0
votes
2 answers

SCSS data-theme="dark" variables doesnt load

im currently working on a dark mode for my site and the JS is working fine, it adds the data-theme="dark" parameter to the html tag and stores it in the local storage. But the variables in SCSS just wont load. Here is my code: $colorMain:…
skitz
  • 3
  • 5
0
votes
1 answer

How to dynamically change data-theme of page element in jQuery Mobile

Using jQuery mobile 1.3.2, I have a PhoneGap application in which I would like to update an initial login screen to reflect a data theme, based on the state of the application. login page html is: login html:
Gthoma2
  • 687
  • 1
  • 9
  • 22
0
votes
1 answer

ajax replace data-theme but trigger('create') or listview('refresh') doesn't work

Greeting, I am trying to replace data-theme but never apply change with trigger.('create') or listview('refresh') Please test my code at JSFIDDLE Thank you for your help Here is my code ... HTML:
fanartie
  • 1
  • 1