改变我的jquery移动主题改变了我的CSS风格

R D*_*abh 2 html javascript css jquery-mobile

我有一个可折叠的设置,我在我的网站上创建,看起来类似于:

<div data-role="collapsible-set" id="result" style="margin: auto; padding-top: 50px; padding-bottom: 20px;">
     <div>
         <h2>
        <span style="font-size: 16px; font-weight: bold; white-space: pre-wrap;" id="title' + num + '">abc</span><br>
        <span style="font-size: 14px; font-weight: normal;" id="author' + num + '"></span>
        <div style="font-weight: normal;">
            <span style="font-style:italic; font-size: 13px;" id="journal' + num + '"></span>
        </div>
        </h2>
        <div style="font-size: 14px;">
            more info
        </div>
     </div>       
</div>
Run Code Online (Sandbox Code Playgroud)

但是,在我将一个主题应用到我添加到可折叠集的每个元素后,我的样式发生了变化,我无法弄清楚原因.在我在可折叠集合中添加div之前,我添加了以下属性:

div.setAttribute("data-theme", "c");
Run Code Online (Sandbox Code Playgroud)

这是我的列表项在样式之前的样子:

在此输入图像描述

这是我添加主题后的样子:

在此输入图像描述

如您所见,每条线之间的间距现在非常大.我试图使用填充更改css,但这并没有改变任何东西.有人能指出我正确的方向吗?

这是一个前后小提琴:

之前

Oma*_*mar 7

您需要使用jQuery Mobile ThemeRoller进行升级 .theme-classic.css

  1. 转到下载页面并向下滚动到" 旧版本 "
  2. 在1.3.2版本下 - CSS打开未压缩的默认主题:jquery.mobile-1.3.2.css,复制其内容.
  3. 转到jQuery Mobile ThemeRoller,从顶部工具栏中单击" 导入或升级 ".将打开一个新窗口
  4. 在该窗口中,粘贴1.3.2 CSS样式.从selectmenu中,选择" 升级到版本1.4.5 ",然后单击" 导入 "按钮
  5. 查看复制的主题,根据需要进行更改.完成后,单击顶部工具栏中的" 下载 ",为主题提供自定义名称并下载升级的经典主题.
  6. 按以下顺序放置新主题和其他依赖项

    <head>
      <link rel="stylesheet" href="css/themes/my-custom-theme.css" />
      <link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" />
      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" /> 
      <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> 
      <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    </head> 
    
    Run Code Online (Sandbox Code Playgroud)

演示

  • 这完美地改变了相应的样式.非常详细的说明.谢谢! (2认同)