2012-02-23 50 views
1

我的具体问题是,我想在jQuery Mobile的实现这一点:在骑CSS在jQuery Mobile的

http://www.rwe-uk.com/blog/comments/ichat_like_speech_bubbles_with_css_3

发生了什么事是,我可以看到页面寻找完美了大约半其次,然后JQuery Mobile将它变成灰色。

我想更一般的问题是我如何让JQuery Mobile离开页面的一部分?

我已经在Google上搜索了很多,我已经看到了使用Themeroller的建议,但是我看不到如何使用它来设置这些特定的样式。

我也试过使用data-role =“none”,但似乎只对表单元素有效。

编辑:

下面的代码:

<html> 
    <head> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script> 
    <link rel="stylesheet" href="http://www.rwe-uk.com/static/ichat_with_css3/style_5.css" /> 
    </head> 
    <body> 
    <div data-role="page"> 
     <div class="commentArea"> 
     <div class="bubbledLeft"> 
      Hi 
     </div> 
     <div class="bubbledRight"> 
      Hi there yourself 
     </div> 
     </div> 
    </div> 
    </body> 
</html> 

如果我删除了jQuery Mobile的脚本行,它工作正常。

+0

不能重写jqm的css? – ghostCoder 2012-02-23 15:02:01

+0

请发布一些示例代码,可以看到这个问题。 – user700284 2012-02-23 15:26:40

回答

5

您既可以修改页面的样式:

<div data-role="page" style ="background: transparent;"> 

或者添加自定义类:

.ui-content-transparent{ 
    background: transparent !important; 
} 

-

<div data-role="page" class="ui-content-transparent"> 

Example

+0

这很棒 - 非常感谢你! – user1228295 2012-02-23 20:55:40

0

我已经实现的方式,这是通过加载CSS按以下顺序:从的ThemeRoller

  • 的jquery.mobile.structure-1.0.min.css
  • 我共同

    1. 主题文件压倒一切的风格
    2. 我的平台特定覆盖样式例如android.css或ios.css

    使用样式表的加载顺序很重要。

    当我重写样式表3或4中的样式时,我经常需要使用!important。

    请记住确保您的目标是最终的DOM布局与您的压倒一切的风格。

    我希望这会有所帮助。