Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何填写<;李>;在jquerymobile中_Jquery_Css_Jquery Mobile - Fatal编程技术网

如何填写<;李>;在jquerymobile中

如何填写<;李>;在jquerymobile中,jquery,css,jquery-mobile,Jquery,Css,Jquery Mobile,我有一个带有data role=“listview”属性的。对于元素,我希望在中有一个,它覆盖中的主要内容,当一个人向右滑动时,将动画向右滑动,显示div下面的内容 我的问题是,当我将div添加到元素时,我无法让覆盖元素。即使我将样式设置为style:height=100%,div似乎也只占元素空间的大约2/3。您可以将div元素添加到如下列表项: HTML-- 最后,您可以检测“cover”div上的滑动事件,并在屏幕外设置元素动画: JS-- 下面是一个演示:您可以将DIV元素添加到列表项中

我有一个带有data role=“listview”属性的
。对于
  • 元素,我希望在
  • 中有一个
    ,它覆盖
  • 中的主要内容,当一个人向右滑动时,
    将动画向右滑动,显示div下面的内容


    我的问题是,当我将div添加到
  • 元素时,我无法让
    覆盖
  • 元素。即使我将样式设置为
    style:height=100%
    ,div似乎也只占
  • 元素空间的大约2/3。

    您可以将div元素添加到如下列表项:

    HTML--

    最后,您可以检测“cover”div上的滑动事件,并在屏幕外设置元素动画:

    JS--


    下面是一个演示:

    您可以将DIV元素添加到列表项中,如下所示:

    HTML--

    最后,您可以检测“cover”div上的滑动事件,并在屏幕外设置元素动画:

    JS--


    下面是一个演示:

    检查填充间距和边距检查填充间距和边距
        <ul data-role="listview">
            <li data-icon="grid"><a href="#">This is normal content.</a><div class="cover-div">Swipe to Uncover</div></li>
            <li data-icon="grid"><a href="#">This is normal content.</a><div class="cover-div">Swipe to Uncover</div></li>
            <li data-icon="grid"><a href="#">This is normal content.</a><div class="cover-div">Swipe to Uncover</div></li>
            <li data-icon="grid"><a href="#">This is normal content.</a><div class="cover-div">Swipe to Uncover</div></li>
            <li data-icon="grid"><a href="#">This is normal content.</a><div class="cover-div">Swipe to Uncover</div></li>
        </ul>
    
    <li data-icon="grid" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-iconpos="right" data-theme="c" class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-btn-up-c">
        <div class="ui-btn-inner ui-li">
            <div class="ui-btn-text">
                <a href="#" class="ui-link-inherit">This is normal content.</a>
                <div class="cover-div">Swipe to Uncover</div>
            </div>
            <span class="ui-icon ui-icon-grid ui-icon-shadow">&nbsp;</span>
        </div>
    </li>
    
    .cover-div {
        position   : absolute;
        top        : 0;
        left       : 0;
        width      : 100%;
        height     : 100%;
        z-index    : 2;
        background : #000;
        background : rgba(0, 0, 0, 0.7);
        color      : #fff;
    }​
    
    //when a page is initialized by jQuery Mobile, we'll do our own initialization
    $(document).delegate('[data-role="page"]', 'pageinit', function () {
    
        //find all the `.cover-div` elements on this page and bind to swipe left/right events for the elements
        $(this).find('.cover-div').bind('swipeleft swiperight', function (event) {
    
            //if the user swiped to the left then animate the DIV to the left
            if (event.type == 'swipeleft') {
                $(this).stop().animate({ left : '-100%' }, 250);
    
            //otherwise animate the DIV to the right
            } else {
                $(this).stop().animate({ left : '100%' }, 250);
            }
        });
    });
    ​