小编mes*_*nio的帖子

jQuery scale div内容(嵌套div)

如何让红色框与红色框一起缩放?(使用jQuery-UI)

http://jsfiddle.net/Y54EB/1/

这是基本代码,CSS:

#outer {
    position:relative;
    height:100px;
    width:150px;
    z-index:1;
    background:#F00;
}
#nested {
    position:absolute;
    left:50px; top:20px;
    width:50px; height:20px;
    z-index:2;
    background:#00F;
    cursor:pointer;
}
Run Code Online (Sandbox Code Playgroud)

和HTML:

<div id="outer">
<div id="nested" onclick="$('#outer').effect('scale', {scale:'content',percent:50}, 1000);" />
</div>
Run Code Online (Sandbox Code Playgroud)

html jquery nested absolute scale

1
推荐指数
1
解决办法
2万
查看次数

CORONA:如何在触摸或点击时消除物体?

我有石头和苹果等物体连续下落,现在我需要在触摸时消除苹果并得到我触摸的苹果数量....请帮助......我对CORONA全新......这是我的代码:

function newApples()    
rand = math.random( 100 )

if (rand < 60) then
    j = display.newImage("s1.png");
    j.x = 60 + math.random( 160 )
    j.y = -100
    physics.addBody( j, { density=0.9, friction=0.3, bounce=0.3} )
elseif (rand < 80) then
    j = display.newImage("s2.png");
    j.x = 60 + math.random( 160 )
    j.y = -100
    physics.addBody( j, { density=1.4, friction=0.3, bounce=0.2} )
else
    apple = display.newImage("apple1.png");
    apple.x = 60 + math.random( 160 )
    apple.y = -100
    physics.addBody( apple, { density=0.3, friction=0.2, bounce=0.5} )
    apple.name …
Run Code Online (Sandbox Code Playgroud)

coronasdk

1
推荐指数
1
解决办法
1406
查看次数

插入数据后无法刷新JTable内容

我正在实现JTable作为用户注册表单,我差不多完成了,但是当添加数据时它没有显示输入的最新数据,并且JTable的大小也非常小.我怎么能增加呢?

代码在下面的链接JTable实现中

java swing jtable defaulttablemodel

1
推荐指数
1
解决办法
389
查看次数

在iOS中旋转视频

我是iOS新手.

我有一个录制视频的应用程序,并在iPad上播放.

现在我必须在视野中打开相机.所以我使用了avcapturesession.

现在通过我的编码,我可以录制和播放视频,但录制的视频处于旋转模式.

我使用LandscapeRight进行录制.

这是我的编码:

AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
                    captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;

                    captureVideoPreviewLayer.orientation=AVCaptureVideoOrientationLandscapeRight;
                    captureVideoPreviewLayer.frame = vwvideo.bounds;

                    [vwvideo.layer addSublayer:captureVideoPreviewLayer];

                    AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

                    NSError *error = nil;
                    AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
                    if (!input) {
                        // Handle the error appropriately.
                        NSLog(@"ERROR: trying to open camera: %@", error);
                    }

                    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

                    AVCaptureMovieFileOutput *movieFileOutput = [[AVCaptureMovieFileOutput alloc] init];

                    NSString *documentsDirectory = [paths objectAtIndex:0];

                    NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init] autorelease];
                    [dateFormat setDateFormat:@"yyyy-MM-dd HH.mm.SS"];
                    NSDate …
Run Code Online (Sandbox Code Playgroud)

iphone video camera ipad ios

1
推荐指数
1
解决办法
3556
查看次数

jQuery从选择器获取实际的data-id

我在网页上有一个带有数据ID和值的选择器

HTML

    <select id="s1">
        <option data-id="01">aaaa1</option>
        <option data-id="23">bbb1</option>
        <option data-id="451">ccc1</option>
        <option data-id="56">ddd1</option>

    </select>

<p></p>
Run Code Online (Sandbox Code Playgroud)

JAVASCRIPT

$('#s1').change(function() { 
       var val = $(this).val();   
       var val_id =$(this).find('option').data('id');
       $("p").html("value = " + val + "<br>" +"value-data-id = "+  val_id);
});
Run Code Online (Sandbox Code Playgroud)

我想从选定的选择器和他的data-id获得实际值.我不明白为什么我只有第一个选项的数据ID.这是我的代码http://jsfiddle.net/s55rR/ 请帮我找一个bug.

javascript jquery

0
推荐指数
1
解决办法
1766
查看次数