Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用JQuery Mobile在listview中设置select的格式_Jquery_Css_Jquery Mobile - Fatal编程技术网

如何使用JQuery Mobile在listview中设置select的格式

如何使用JQuery Mobile在listview中设置select的格式,jquery,css,jquery-mobile,Jquery,Css,Jquery Mobile,这就是我现在拥有的: 我希望选择按钮位于计数的右侧,而不影响列表项的垂直大小和对齐方式 我试过: 基于.ul li count类创建CSS,但仅成功破坏了jQM增强功能 在listview外部单独创建按钮,但我无法垂直对齐它们 玩弄字段集、数据角色、div等,但没有成功 好吧,不可能以编程方式调用select,否则我会在listview中添加一个普通按钮 非常感谢您的帮助,包括对其他文档布局的建议。如果我理解正确,您可以使用一些非常简单的CSS来更改jQuery Mobile的默认布局: /*a

这就是我现在拥有的:

我希望选择按钮位于计数的右侧,而不影响列表项的垂直大小和对齐方式

我试过:

  • 基于
    .ul li count
    类创建CSS,但仅成功破坏了jQM增强功能
  • 在listview外部单独创建按钮,但我无法垂直对齐它们
  • 玩弄字段集、数据角色、div等,但没有成功
  • 好吧,不可能以编程方式调用select,否则我会在listview中添加一个普通按钮


    非常感谢您的帮助,包括对其他文档布局的建议。

    如果我理解正确,您可以使用一些非常简单的CSS来更改jQuery Mobile的默认布局:

    /*absolutely position the <select> to the right side of the <li> and center it within the <li>*/
    .custom_list .ui-select {
        position   : absolute;
        right      : 10px;
        top        : 50%;
        margin-top : -1.4em;
    }
    /*add some extra padding to the right side of the <li> to make the text wrap properly*/
    .custom_list .ui-li {
        padding-right : 80px;
    }
    /*change the position of the <span class="ui-li-count"> to make room for the <select>*/
    .custom_list .ui-li-count {
        right : 50px;
    }
    
    /*绝对将其放置在
  • 的右侧,并将其置于
  • 的中心位置*/ .custom_list.ui选择{ 位置:绝对位置; 右:10px; 最高:50%; 保证金顶部:-1.4em; } /*在
  • 的右侧添加一些额外的填充以使文本正确换行*/ .custom_list.ui li{ 右边填充:80px; } /*更改的位置,以便为*/ .custom_list.ui li计数{ 右:50px; }
  • 请注意,我正在使用
    .custom\u list
    类以所需的
      元素为目标,因此,要使此解决方案正常工作,您必须从上面的CSS声明中删除
      .custom\u list
      ,或者将
      .custom\u list
      类添加到要自定义的
        元素中

        以下是上述解决方案的一部分: