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 6244137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:16:20+00:00 2026-05-24T12:16:20+00:00

I have an app built using jQuery (and using various jQuery-UI tools). For some

  • 0

I have an app built using jQuery (and using various jQuery-UI tools).

For some reason, i have to port it to smartphones/tablet computer, and decided to use jQuery Mobile for that (in order to minimize the number of changes).

In my vanilla app, I created some elements of the page on the fly, depending of user interactions.

For example a slider could be created like that (p is an object with a bunch of params):

function createSlider(p){
     return $("<div/>",{
              "id":p.id,
              "class":p.divClass,
           }).slider({
              "orientation": p.align,
              "min":p.constraint.min,
              "max":p.constraint.max,
              "step":p.step,
              "value":p.curVal,
              "animate":"normal"
              /*and some event handling here, but it doesn't matter*/
           });

}

And it will produce a nice looking slider. Now it looks like:

function createSlider(p){
    return $("<range/>",{
           "id":p.id,
           "class":p.divClass,
           "min":p.constraint.min,
           "max":p.constraint.max,
           "step":p.step,
           "value":p.curVal,
    });   
}

But as it’s created on the fly, all the stuff done by jQuery Mobile on the page load isn’t done on it.

Is there a way to force that initialization without writing the slider in the html?

Thanks.

EDIT: I found in the doc that it could be achieved using container.trigger("create");
However this does not work yet.

EDIT2: Ok create was the solution.

  • 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-24T12:16:20+00:00Added an answer on May 24, 2026 at 12:16 pm

    According to the documentation (see edit in the question), using trigger("create") on the containing element works.

    And to make that work, you also need to remember that range is an input type and not a tag…

    Working solution:

    function createSlider(){
        return $("<input/>",{
               "type":"range",
               "id":"sl",
               "min":0,
               "max":15,
               "step":1,
               "value":1,
        });   
    }
    
    function appendSlider(){
        $("#yourdiv").append(createSlider()).trigger("create");
    }
    

    As a sidenote, the documentation for jQuery mobile lacks a search option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We recently built a web app using Prototype, making a fair amount of use
I have a mobile web application built using the following versions :- JQuery Mobile
I have built a test app on android using this cool-ass PhoneGap framework, but
I have some experience of developing in Flex/Actionscript using Cairngorm framework. At that time
It's my understanding that StackOverflow (SO) was built using ASP.NET. What surprised me is
A friend of mine uses a web-app for work related purposes. The app's built
I need to display dates in a couple different ways in an app built
I'm using the jQuery datepicker to select dates. It works fine, except there is
I am new to HTML, and I'm trying to build a mobile app using
We currently have a custom inventory system used to track different assets. The items

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.