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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:37:09+00:00 2026-06-06T14:37:09+00:00

In a plugin I’m writing, the dev can specify options, which I’m storing and

  • 0

In a plugin I’m writing, the dev can specify options, which I’m storing and referencing like so:

(function( $, window) {
    $.widget("mobile.plug", $.mobile.widget, {
        options: {
            menuWidth: '25%',
            middleWidth: '25%',
            mainWidth: '25%'
            },
         some: function(){
            var self = this,
                o = self.options;

            console.log( o.menuWidth );
            }
     })
}) (jQuery,this);

My Question:
Say I want to loop through all three elements (main, menu, middle) and get the respective option value, how would I construct o.[elem]Width dynamically, if at all possible?

This doesn’t work (ERROR: missing name after . operator):

// this selects panels with jqmData(panel="mid|menu|main")
var elems = $('selector');

for (var i = 0; i<elems.length; i++){
   var el = elems.eq(i);
   console.log( o.[el.jqmData("panel")]Width );
   }
  • 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-06-06T14:37:10+00:00Added an answer on June 6, 2026 at 2:37 pm

    You should be able to concatenate “Width” to the “panel” result:

    o[el.jqmData("panel") + "Width"]
    

    E.g., if el.jqmData("panel") is “menu” you would get o["menuWidth"].

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

Sidebar

Related Questions

Plugin: (function( $ ){ $.fn.myplugin = function( options ) { var mymethod = function(){
See plugin config from pom.xml below. I can do: mvn myplugin:myGoal Which runs myGoal
I'm writing a plugin to 3-rd party server application. I'd like to know how
The plugin base class in Play 1, is play.PlayPlugin , which has a lot
I'm building a plugin system for my application. I've read that anyone can decomple
Is there a firefox plugin which functions as an SVN client? I have checked
The plugin declared in my application.ini file is not being triggered. I can install
I'm creating jQuery plugin: $.fn.myGrid = function () { return ???; } I want
this plugin elastic, (function (jQuery) { jQuery.fn.extend({ elastic: function () { var mimics =
A plugin which I need to implement in other website uses some jquery functions.

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.