javascript - LTR 到 RTL jQuery Collapsibles block

标签 javascript jquery html css

我想知道如何将 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>

此外,您可以看到第一个元素,因为有很多文本,即使您单击展开,它也不会显示。

请指教 谢谢 亲切的问候

最佳答案

我已经复制了您要反转的带有“+”符号的 block 。我添加了 4 行,它成功了。见下文,如果你删除/评论我的 4 行,“+”会回到左边:

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 */

}
<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>

关于javascript - LTR 到 RTL jQuery Collapsibles block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28585542/

相关文章:

javascript - 带一个 handle 的 slider - 更新两个值

jquery - 实时 'required fields',输入内有标签

html - 如何修改正则表达式以删除所有后跟 CR 或 LF 的字符串

javascript - 在一系列 float : left divs 中创建/删除一行

javascript - jQuery 一次只显示一个 div

c# - 使用 RazorEngine 插入要呈现为 HTML 的 html 填充模板

javascript - 如何在 Fabric.js 中将对象动态缩放到 Canvas 大小

javascript - 通过 AJAX 发送变量后无法获取 $_POST 值

javascript - 如何在 perl 中使用 WWW::Scripter 模块设置引荐来源网址?

jquery - 添加类不起作用。我的选择器不够具体吗?