我根据宽度看到高度的解决方案:css高度与宽度相同.或者在这里:https://stackoverflow.com/a/6615994/2256981.但我的问题恰恰相反.
我的元素:
<body>
<div id="square"></div>
</body>
Run Code Online (Sandbox Code Playgroud)
风格:
body, html {
margin: 0;
height: 100%;
min-height: 300px;
position: relative;
}
div#square { /* My square. */
height: 75%; /* It's height depends on ancestor's height. */
width: 75vh; /* If supported, preliminarily sets it's width. */
position: absolute; /* Centers it. */
left: 50%; top: 50%; transform: translate(-50%, -50%);
background-color: darkorange; /* Makes it visible. */
}
Run Code Online (Sandbox Code Playgroud)
脚本,保持正方形:
window.onload = window.onresize = function (event) { …
Run Code Online (Sandbox Code Playgroud) 由圆形父子项隐藏的部分裁剪仍然在Chrome中保持并处于活动状态:
IE中的相同行为可以通过向z-index
父级添加属性来解决.仍然找不到Chrome的治愈方法.
#container {
width: 200px;
height: 200px;
border-radius: 50%;
background-color: orange;
position: fixed;
overflow: hidden;
/*z-index: 1;*/
}
#element {
width: 100px;
height: 100px;
background-color: blue;
position: absolute;
top: 150px;
left: 100px;
cursor: pointer;
}
Run Code Online (Sandbox Code Playgroud)
<div id="container">
<div id="element"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我有:
在INSTALLED_APPS
:
INSTALLED_APPS = (
'grappelli',
'filebrowser',
'django.contrib.admin',
Run Code Online (Sandbox Code Playgroud)
在urlpatterns
:
from filebrowser.sites import site
urlpatterns = patterns[
url(r'^admin/filebrowser/', include(site.urls)),
url(r'^grappelli/', include('grappelli.urls')),
url(r'^tinymce/', include('tinymce.urls')),
url(r'^admin/', include(admin.site.urls)),
]
Run Code Online (Sandbox Code Playgroud)
这似乎工作正常.
我的目标MEDIA_ROOT
是'D:\\sites\\my_site\\public_html\\media\\'
.
我FILEBROWSER_DIRECTORY = 'D:\\sites\\my_site\\public_html\\media\\'
也在我的设置中设置,但仍然在浏览时出错http://localhost:8000/admin/filebrowser/browse/
:
ImproperlyConfigured at /admin/filebrowser/browse/
Error finding Upload-Folder (site.storage.location + site.directory). Maybe it does not exist?
Run Code Online (Sandbox Code Playgroud) 实际上(使用 w3.org doc 的示例http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/#dom-context-2d-ispointinpath)我确实想出了如何在原始 HTML5Canvas/ 中完成它JavaScript:http : //jsfiddle.net/QTu9E/4/
上面我使用了isPointInPath(x, y)
语法,但根据提到的文档,也可以isPointInPath(path, x, y[, w ])
在其中指定某些路径进行检查。
这可能是问题解决者,但我无法仅将 paperjs 的Path
对象传递给它!
我将继续寻找解决方案,因为和其他任何人一样,我都有截止日期,但任何帮助将不胜感激!