未捕获的TypeError:无法设置undefined main.js的属性'dropEffect'未
捕获的TypeError:无法读取未定义的属性'files'
这里有什么不对
.咖啡
$ ->
app = new Viewr
class Viewr
constructor: () ->
$('#drop_zone')
.bind('dragover', @handleDragOver)
.bind('drop', @handleDrop)
handleDrop: (evt) ->
evt.stopPropagation()
evt.preventDefault()
files = evt.dataTransfer.files
@setActiveImage files[0]
handleDragOver: (evt) ->
evt.stopPropagation()
evt.preventDefault()
evt.dataTransfer.dropEffect = "copy"
setActiveImage: (image)->
$("img").attr "src", src
Run Code Online (Sandbox Code Playgroud)
.HTML
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div id="drop_zone" style="width: 100px; height: 100px; border: 2px dashed #bbb;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding: 25px;
text-align: center;
color: #bbb;">Drop files here</div> …Run Code Online (Sandbox Code Playgroud) 哪些浏览器已经支持其中一些属性? http://dev.w3.org/csswg/mediaqueries4/
这个fe不适用于iOS7,iPhone 4S
@media (luminosity: normal) {
body {
background: #f5f5f5;
color: #262626;
}
}
@media (luminosity: dim) {
body {
background: #e9e4e3;
}
}
@media (luminosity: washed) {
body {
background: #ffffff;
}
}
Run Code Online (Sandbox Code Playgroud) 我想在UIScrollView中滚动我的内容.但我认为我犯了一个错误.
// setup view
CGRect appFrame = [UIScreen mainScreen].applicationFrame;
CGRect frame = CGRectMake(0, 0, appFrame.size.width, appFrame.size.height);
self.view = [[[UIView alloc] initWithFrame:frame] autorelease];
// setup wrapper
UIScrollView *wrapper = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, appFrame.size.width, appFrame.size.height + 320)];
wrapper.backgroundColor = [UIColor redColor];
wrapper.scrollEnabled = YES;
[self.view addSubview:wrapper];
// title (simple version here)
title.text = "Hello World";
[wrapper addSubview:title];
Run Code Online (Sandbox Code Playgroud) 我想知道我是否可以通过浏览器插件访问网络摄像头,例如Firefox,Safari,Internet Explorer等?
是否已有类似的插件/插件?
谢谢
我刚从8.2更新了我的项目.到8.3(使用最新的xCode版本6.3 6D570).现在我收到了这个错误
错误:WatchKit应用程序的部署目标必须等于iOS 8.2(8.3).
项目和所有目标都设置为最新的SDK 8.3
我错过了什么?
我想发布一个开放的图形活动.实际上它正在使用静态.html文件.但如果我指向url params的url,我会收到一个错误.两个页面上的源代码是100%相同,相信我.
# Dynamic call
/me/somesandbox:drive?car=http://www.domain.com/object/?og:type=somesandbox:car&og:title=Some%20car
# Static call
/me/somesandbox:drive?car=http://www.domain.com/static_car.html
Run Code Online (Sandbox Code Playgroud)
错误:
" '网站'类型的网址' http://www.domain.com/object/?og:type '上的对象无效,因为未提供类型为'string'的必需属性'og:type'."
如果你看一下这个错误,你会看到,Facebook没有得到整个网址.没错了,对吧.请帮忙!
我如何等待几种方法完成?
这是客观的解决方案:
self.dispatch_group = dispatch_group_create();
dispatch_group_notify(self.dispatch_group, dispatch_get_main_queue(), ^{
});
dispatch_group_leave(strongSelf.dispatch_group);
Run Code Online (Sandbox Code Playgroud) 我知道如何在新的快速项目中使用cocoapods吗?
但是如何使用swift创建自己的cocoapod呢?
pod lib lint产生此错误:
- NOTE | [xcodebuild] warning: no rule to process file '/Pod/Classes/SomeClass.swift' of type text for architecture armv7
Run Code Online (Sandbox Code Playgroud)
编辑: 刚刚发现这个快速分支:https: //github.com/CocoaPods/CocoaPods/tree/swift
该WatchKit参考似乎使这件事没有提及.我错过了什么吗?或者,在Apple Watch应用程序中实现摇动手势真的不可能吗?
以下是iOS上摇动手势实现的典型示例:
// MARK: Gestures
override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent) {
if(event.subtype == UIEventSubtype.MotionShake) {
// do something
}
}
Run Code Online (Sandbox Code Playgroud) swift ×3
ios ×2
watchkit ×2
browser ×1
cocoapods ×1
coffeescript ×1
css3 ×1
ember.js ×1
facebook ×1
html ×1
iphone ×1
javascript ×1
objective-c ×1
parameters ×1
plugins ×1
request ×1
uiscrollview ×1
url ×1
xcode ×1