javascript – 造型jquery手机列表

前端之家收集整理的这篇文章主要介绍了javascript – 造型jquery手机列表前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图设置一个listview控件,但是有问题…当我将图像的宽度设置为40px,如标记所示.我似乎无法让内容正确对齐.即.我不想要图像和文本之间的差距.这是我的标记
<ul data-role="listview" class="ui-listview" data-inset="true" role="listBox">
        <li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-c" style='font-size:8pt;font-weight:normal'>
          <?PHP echo fmtDate($x->date); ?>,<?PHP echo $name; ?> wrote on <?PHP echo $wname; ?>'s wall
          <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style='right:55px;background: url(../images/comment.png) no-repeat;padding:3px;padding-left:20px'>34</span>
          <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style='right:5px;background: url(../images/like.gif) no-repeat;padding:3px;padding-left:20px'>442</span>
        </li>

        <li role="option" tabindex="0" data-theme="c" >
        <a href='#'>
        <img width="40" height="40" src='<?PHP echo $imgstr; ?>'/>
        <div style='font-size:9pt;font-weight:normal;'><?PHP echo nl2br(addSmilies(urlize(trim($x->msg))));?></div>                
        </a>
        </li>
    </ul>

只是为了澄清这是我从’检查元素’得到的标记

<ul data-role="listview" class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" role="listBox">
                <li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-c ui-corner-top ui-btn-up-undefined" style="font-size:8pt;font-weight:normal">
                  Today,55 minute(s) ago,Maggie Ferguson wrote on Maggie's wall
                  <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style="right:55px;background: url(../images/comment.png) no-repeat;padding:3px;padding-left:20px">34</span>
                  <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style="right:5px;background: url(../images/like.gif) no-repeat;padding:3px;padding-left:20px">442</span>
                </li>

                <li role="option" tabindex="-1" data-theme="c" class="ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-corner-bottom ui-btn-up-c"><div class="ui-btn-inner"><div class="ui-btn-text">
                <a href="#" class="ui-link-inherit">
                <img width="40" height="40" src="../members/mariamjohnson/media/878_thumb.jpg" class="ui-li-thumb ui-corner-bl">
                <div style="font-size:9pt;font-weight:normal;">WAIT A MINUTE,GWE DAN CAN YOU PLEASE BEHAVE YOURSELF,IF YOU HAVE NOTHING TO DO,GO GET YOURSELF WASTED ELSEWHERE,YOU ARE ABUSIVE AND YOU ARE BEGINING TO IRRETATE ME LIKE A RASH.GURU CHAIN HIM UP,HE SHOULD NOT SPEAK UNTIL SPOKEN TO,OK?</div>                
                </a>
                </div><span class="ui-icon ui-icon-arrow-r"></span></div></li>
            </ul>

看起来像jquery手机添加额外和类到mrkup …任何解决方案?

解决方法

添加jQuery mobile CSS并添加样式后,添加一个CSS文件
.ui-li-has-thumb .ui-btn-inner {
    min-height: 60px;
    padding-left: 100px;
}

用你喜欢的填充,例如

.ui-li-has-thumb .ui-btn-inner {
    min-height: 60px;
    padding-left: 60px;
}
原文链接:https://www.f2er.com/jquery/150860.html

猜你在找的jQuery相关文章