LTR到RTL jQuery可折叠块

时间:2015-02-18 14:03:40

标签: javascript jquery html5 css3

我当时想知道如何从LTR转换为RTL

http://www.beladitvnews.com/news/en-iraqi-mofa-ambassadors转到RTL。

用于创建此代码的代码是:



<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Collapsible Blocks</h1>
  </div>

  <div data-role="main" class="ui-content">
    <div data-role="collapsible">
      <h1>Click me - I'm collapsible!</h1>
      <p>I'm the expanded content.</p>
    </div>
  </div>

  <div data-role="footer">
    <h1>Insert Footer Text Here</h1>
  </div>
</div> 

</body>
</html>
&#13;
&#13;
&#13;

另外,因为你可以看到第一个元素,因为很多文字,即使你点击展开也没有显示。

请指教 谢谢 亲切的问候

1 个答案:

答案 0 :(得分:0)

我用&#34; +&#34;复制了这个块。签字你试图扭转。我添加了4行,它就是诀窍。如果您删除/评论我的4行,请参阅下文,&#34; +&#34;回到左边:

&#13;
&#13;
div{
    background : lightgrey;
    padding: 10px;
}

a.ui-icon-plus{
    display: block;
    position: relative;
    
    padding-left: 40px;    /* this is the original value */
    padding-right: 16px;   /* this is the original value */
    
    padding-left: 16px;  /* Added this to overwrite */
    padding-right: 40px; /* Added this to overwrite */
   
}

a.ui-icon-plus:after{

    content: "";
    left: 9px;
    margin-top: -11px;
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 1em;
    display: block;
    background-color: rgba(0,0,0,.3);
    background-position: center center;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C5%209%2C5%209%2C0%205%2C0%205%2C5%200%2C5%200%2C9%205%2C9%205%2C14%209%2C14%209%2C9%2014%2C9%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
    
    left: auto;     /* Added this to overwrite */
    right: 0;       /* Added this to overwrite */

}
&#13;
<div>
    <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed">
        <a href="#" class="ui-icon-plus">
            Dhiaa Hadi Mahmoud AlDabas -----&gt;
            <br>
            Iraq's Ambassador to the republic of Iraq in Cairo and The Representative of Iraq to the Arab Leaque
        </a>
    </h3>
</div>
&#13;
&#13;
&#13;