在Twitter 2.3.x上,photoswipe杀死了选择框

时间:2012-03-27 10:18:55

标签: android jquery-mobile photoswipe

当页面上显示photoswipe实例时,同一页面上的所有选择框都不再适用于android 2.3.x(2.3.3在模拟器中测试,2.3.5在Galaxy S2上测试)。

当thumbstrip_z.show(0);在选择框下方的脚本中进行了评论。

这可以解决吗?还是我做错了什么?

祝你好运, 库尔特

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
    <link href="http://www.photoswipe.com/latest/photoswipe.css" type="text/css" rel="stylesheet" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script type="text/javascript" src="http://www.photoswipe.com/latest/lib/klass.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    <script type="text/javascript" src="http://www.photoswipe.com/latest/code.photoswipe.jquery-3.0.4.min.js"></script>
</head>

<body>
    <div data-theme="d" data-role="page">
        <div class="photo_holder" id="media_pics">
            <div id="album_z" class="album">
                <div id="paging_z" class="paging" style="height:300px;">

                </div>
            </div>
        </div>
        <select><option value="0">0</option><option value="1">1</option><option value="2">2</option></select>
    </div>

<script type="text/javascript">
    var fullscreenPhotoSwipePhotos_z = new Array(); 
    var thumbstripPhotos_z = new Array();

    fullscreenPhotoSwipePhotos_z[0] = { url: 'http://media.leisure-ict.net/photo/web/500/BE-1000-01_2010050338028065371.jpg', caption: 'cap1', id: 0};
    thumbstripPhotos_z[0] = { url: 'http://media.leisure-ict.net/photo/web/170/BE-1000-01_2010050338028065371.jpg', caption: 'cap1', id: 0};
    fullscreenPhotoSwipePhotos_z[1] = { url: 'http://media.leisure-ict.net/photo/web/500/BE-1000-01_2010050338020829330.jpg', caption: 'cap1)', id: 1};
    thumbstripPhotos_z[1] = { url: 'http://media.leisure-ict.net/photo/web/170/BE-1000-01_2010050338020829330.jpg', caption: 'cap1', id: 1};
    fullscreenPhotoSwipePhotos_z[2] = { url: 'http://media.leisure-ict.net/photo/web/500/BE-1000-01_2010050338081598787.jpg', caption: 'cap1', id: 2};
    thumbstripPhotos_z[2] = { url: 'http://media.leisure-ict.net/photo/web/170/BE-1000-01_2010050338081598787.jpg', caption: 'cap1', id: 2};
    fullscreenPhotoSwipePhotos_z[3] = { url: 'http://media.leisure-ict.net/photo/web/500/BE-1000-01_2010050338024088090.jpg', caption: 'cap1', id: 3};
    thumbstripPhotos_z[3] = { url: 'http://media.leisure-ict.net/photo/web/170/BE-1000-01_2010050338024088090.jpg', caption: 'cap1', id: 3};
    fullscreenPhotoSwipePhotos_z[4] = { url: 'http://media.leisure-ict.net/photo/web/500/BE-1000-01_2010050338049077588.jpg', caption: 'cap1', id: 4};
    thumbstripPhotos_z[4] = { url: 'http://media.leisure-ict.net/photo/web/170/BE-1000-01_2010050338049077588.jpg', caption: 'cap1', id: 4};

    (function(window, Util, PhotoSwipe){

        Util.Events.domReady(function(e){

            var thumbstrip_z;
            var fullscreenPhotoSwipe_z;

            var showSummerEl;

            fullscreenPhotoSwipe_z = PhotoSwipe.attach(
                fullscreenPhotoSwipePhotos_z,
                {
                    getImageSource: function(obj){
                        return obj.url;
                    },
                    getImageCaption: function(obj){
                        return obj.caption;
                    },
                    captionAndToolbarHide: false,
                    margin: 0
                }
            );

            thumbstrip_z = PhotoSwipe.attach(
                thumbstripPhotos_z,
                {
                    target: window.document.querySelectorAll('#paging_z')[0],
                    preventHide: true,
                    getImageSource: function(obj){
                        return obj.url;
                    },
                    getImageCaption: function(obj){
                        return obj.caption;
                    },
                    captionAndToolbarHide: true,
                    margin: 0,
                    //imageScaleMethod: "fitNoUpscale",
                    swipeThreshold: 100,
                    swipeTimeThreshold: 10
                }
            );

            thumbstrip_z.show(0);

            // onTouch
            thumbstrip_z.addEventHandler(PhotoSwipe.EventTypes.onTouch, function(e){
                if(e.action === 'tap' || e.action === 'doubleTap'){
                    fullscreenPhotoSwipe_z.show(thumbstrip_z.getCurrentImage().refObj.id);
                }
            });         
        });
    }(window, window.Code.Util, window.Code.PhotoSwipe));
</script>
</body>
</html>

0 个答案:

没有答案