Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:53:30+00:00 2026-05-30T21:53:30+00:00

In my footer, I wrote this function… jQuery(‘#page’).live(‘pageinit’, function() { $(‘.widget ul’).attr(‘data-inset’, ‘true’); $(‘.widget

  • 0

In my footer, I wrote this function…

    jQuery('#page').live('pageinit', function() {
$('.widget ul').attr('data-inset', 'true');
$('.widget ul').attr('data-theme', 'd');
$('.widget ul').attr('data-dividertheme', 'b');
$('.widget ul').attr('data-role', 'listview');
$('.widget ul').listview();
$('a.post-edit-link').attr('data-inline', 'true');
$('a.post-edit-link').attr('data-role', 'button');
$('a.post-edit-link').button();
$('#commentform').attr('data-theme', 'e'); ...

So, how to apply data-theme on the last line ? What is the method, as ‘listview’ or ‘button’?

I also wonder how to apply ‘widget ul’ to the first attribute…

$(‘.widget ul:first’)

is not working.

Thanks for your help!

Sincerely,

V.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:53:32+00:00Added an answer on May 30, 2026 at 9:53 pm

    .widget ul:first will select the first ul element that is a descendant of a .widget element. If you want to select the first list-item in ul then you need: .widget ul li:first.

    Forms themselves do not get initialized by jQuery Mobile, so instead of targeting the form, you need to target the specific input widgets and initialize them.

    To initialize a bunch of elements you can select them all and call .trigger('create') on them:

    $('#commentform').find('input, textarea').trigger('create');
    

    This gets slightly trickier when you want to update widgets rather than initialize them:

    $('#commentform').find('input[data-type="slider"]').slider('refresh').end()
                     .find('input[type="text]').textinput('refresh').end()
                     .find('input[type="checkbox"], input[type="radio"]').checkboxradio('refresh');
    

    Also you can optimize your code by chaining function calls rather than re-selecting the same element(s) multiple times:

    $('.widget ul').attr('data-inset', 'true')
                   .attr('data-theme', 'd')
                   .attr('data-dividertheme', 'b')
                   .attr('data-role', 'listview')
                   .listview();
    
    $('a.post-edit-link').attr('data-inline', 'true')
                         .attr('data-role', 'button')
                         .button();
    

    Or you can pass an object to .attr() to set all of the attributes in one function call:

    $('.widget ul').attr({
                       'data-inset'        : true,
                       'data-theme'        : 'd',
                       'data-dividertheme' : 'b',
                       'data-role'         : 'listview'
                   }).listview();
    
    $('a.post-edit-link').attr({
                             'data-inline' : true,
                             'data-role'   : 'button'
                         }).button();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a Jquery function that I wrote which blacks out the screen after
In the footer of my page, I would like to add something like last
I'm trying to get the footer in my site to look like this: Wilgrove
I wrote my own function that keeps a sidebar fixed on screen after a
I started with this question: Multiple Javascript gadgets per page . After reading up
My site currently handles URL's like this... /?p=home /?p=profile&userid=1 /?p=users.online /?p=users.online&page=23 /?p=mail.inbox /?p=mail.inbox&page=12 ...
When I initially wrote this script, the site design did not require the execution
Just to summarize, I'm trying to make a live page render (browse websites) while
This was my first go at writing some jQuery code completely from scratch, so
I have a simple jQuery script which pushes the footer to the bottom of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.