Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.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
Javascript 使用three.js创建flipboard_Javascript_Jquery_Three.js_Flipboard - Fatal编程技术网

Javascript 使用three.js创建flipboard

Javascript 使用three.js创建flipboard,javascript,jquery,three.js,flipboard,Javascript,Jquery,Three.js,Flipboard,我刚接触过three.js,一周前就开始了这方面的工作。 这真的是一个很好的库,但由于我是新手,我的问题是我想用这个库制作一个fliboard,就像。 只要给我一些简单的想法,让我知道如何使用three.js来做这种事情。试试这样的方法 $(document).ready(function() { $('.box').click(function(e){ if( $('div').hasClass('overlay')==false ){

我刚接触过three.js,一周前就开始了这方面的工作。 这真的是一个很好的库,但由于我是新手,我的问题是我想用这个库制作一个fliboard,就像。
只要给我一些简单的想法,让我知道如何使用three.js来做这种事情。

试试这样的方法

 $(document).ready(function() { 

        $('.box').click(function(e){

            if( $('div').hasClass('overlay')==false ){

            //event.preventDefault();
            var $box = $(this);

            $('<div class="overlay"></div>').prependTo($box);

            var $overlay = $('.overlay');

            $overlay.css( {
                           'position'       : 'absolute',
                           'background-color'   : 'white',
                           'width'              : $box.outerWidth(true),
                           'height'     : $box.outerHeight(true),
                           'left'       : $box.offset().left,
                           'top'        : $box.offset().top,
                           'z-index'        : 99999999
            });                                       
            //$($placeholder).insertAfter('.box');  

            $overlay.animate({
                    width: $(document).width(),
                    height: $(document).height(),
                    left: '0px',
                    top: '0px'
                }, 500, function() {
                    //reset the overlay
                    $overlay.css({'width': ''});
                    $overlay.css({'height': '1500px'});
                    //ajax    
                    $.ajax({  
                        type: "POST",  
                        url: "../ajax/get_event.php",  
                        data: "firstname=clint&lastname=eastwood",  
                        success: function(resp){  
                            // we have the response  
                            $overlay.html(resp);
                            $('.window').fadeIn(200);
                        },  
                        error: function(e){  
                            alert('Error: ' + e);  
                        }  
                    });
            });

            }else{
                //click only on overlay to exit
                var $target = $(e.target);    
                if ( $target.is('.overlay') ) {
                   $('.overlay').remove();
                }
            }  

        });//end box click

    });//end of jquery
    </script>
$(文档).ready(函数(){
$('.box')。单击(函数(e){
if($('div').hasClass('overlay')==false){
//event.preventDefault();
var$box=$(此项);
$('').prependTo($box);
var$overlay=$('.overlay');
$overlay.css({
'位置':'绝对',
“背景色”:“白色”,
“宽度”:$box.outerWidth(真),
“高度”:$box.outerHeight(真),
“left”:$box.offset().left,
'top':$box.offset().top,
“z索引”:9999999
});                                       
//$($占位符).insertAfter('.box');
$overlay.animate({
宽度:$(文档).width(),
高度:$(文档).height(),
左:“0px”,
顶部:“0px”
},500,函数(){
//重置覆盖
$overlay.css({'width':''});
$overlay.css({'height':'1500px'});
//阿贾克斯
$.ajax({
类型:“POST”,
url:“../ajax/get_event.php”,
数据:“firstname=clint&lastname=eastwood”,
成功:功能(resp){
//我们得到了答复
$overlay.html(resp);
$('.window').fadeIn(200);
},  
错误:函数(e){
警报('错误:'+e);
}  
});
});
}否则{
//仅单击覆盖以退出
var$target=$(即target);
如果($target.is('.overlay')){
$('.overlay').remove();
}
}  
});//结束框单击
});//jquery结束

您已经试过什么了吗?发布当前代码以获取帮助提示:正交摄影机、具有纹理贴图的Lambert材质的平面、光线投射。我不会为此使用three.js,因为它很简单,可以通过CSS实现。我会使用CSS 3D转换。不。恐怕我很忙@Shani@Shani不。了解所有CSS属性,并自己应用一些。这是简单的东西。谢谢你的回复,我想做滚动部分,当我向下滚动时,上面的部分被折叠和隐藏,从底部开始的新部分在视口中。