假设你有一些风格和标记:
ul
{
white-space: nowrap;
overflow-x: visible;
overflow-y: hidden;
/* added width so it would work in the snippet */
width: 100px;
}
li
{
display: inline-block;
}Run Code Online (Sandbox Code Playgroud)
<div>
<ul>
<li>1</li> <li>2</li> <li>3</li>
<li>4</li> <li>5</li> <li>6</li>
<li>7</li> <li>8</li> <li>9</li>
<li>1</li> <li>2</li> <li>3</li>
<li>4</li> <li>5</li> <li>6</li>
<li>7</li> <li>8</li> <li>9</li>
<li>1</li> <li>2</li> <li>3</li>
<li>4</li> <li>5</li> <li>6</li>
<li>7</li> <li>8</li> <li>9</li>
</ul>
</div>Run Code Online (Sandbox Code Playgroud)
当你看到这个.该<ul>有一个在底部的滚动条,即使我已经溢出X/Y指定的可见和隐藏价值.
(在Chrome 11和opera(?)上观察到)
我猜测必须有一些w3c规范或者某些东西告诉这件事发生但是对于我的生活我无法理解为什么.
更新: -我找到了一种方法来通过添加另一个元素来实现相同的结果ul.看看这个.
我知道Java和Python(有一些Django)和一点Ruby(没有Rails)和没有Node.js,可能还有更多我不知道的东西.
我刨开始学习网络开发和其完整的堆栈,但是当我看到我周围看到的选项负荷,这让我困惑.我需要基于以下参数的建议
请提出一些建议
谢谢
我已将代码从javascript翻译成c#,可以通过访问http://fractal.qfox.nl/dragon.js上的这个优秀演示找到
我的翻译是为了在点击按钮时只产生一条龙,但我想我错过了我的版本.
有关更多信息,请参阅维基百科文章:Dragon Curve.
不完整的龙分形输出:
码:
public partial class MainPage : UserControl
{
PointCollection pc;
Int32[] pattern = new Int32[] { 1, 1, 0, 2, 1, 0, 0, 3 };
Int32[] position = new Int32[] { 0, 0, 0, 0, 0, 0, 0, 0 };
Boolean toggle;
Char r = default(Char);
Int32 distance = 10; // line length
Int32 step = 100; // paints per step
Int32 skip = 10; // folds per paint
Double x …Run Code Online (Sandbox Code Playgroud) 无论如何都要延迟函数的返回,使用setTimeout().
function foo(){
window.setTimeout(function(){
//do something
}, 500);
//return "some thing but wait till SetTimeout() finished";
}
Run Code Online (Sandbox Code Playgroud) 我想用队列创建一个基数排序实现.
我无法弄清楚我的代码的哪个部分有问题或我应该阅读哪些资源.我的代码可能完全错误,但这是我的实现没有任何帮助(我尚未采用数据结构和算法课程).
我创建了一个函数,但它没有用.在做研究时,我看到了一些代码示例,但对我来说似乎更复杂.
首先,我想找到所有整数的最低有效位数 然后在其下标匹配的队列元素中对它们进行排序, 然后在排序后将所有队列复制到第11个队列元素的末尾.在第11个队列元素中再次进行此排序,直到达到最高位数.
我能找到最不重要的数字.并根据这个数字排序.但是,我无法分析其他数字.例如; 我可以排序1,2,4,5,3,但是当排序2位或更多位数时,它会失败......
我希望,我很清楚并简要地解释了我的问题.
// My function declaration
// Pre: arrInts holds the linked list of integers which are going to be sort.
// Post: queue will return result and its 11th element should hold sorted integers in
// that queue
queue_node_t * radixSort(const queue_node_t *arrInts, queue_t *queue[], int size){
queue_node_t *curNodep = arrInts; // Node to be checked
int i, curNum = curNodep->element.key;
if(curNodep == NULL){
// If there …Run Code Online (Sandbox Code Playgroud) 我正在研究phonegap应用程序.我正在尝试登录,点击Login.html中的提交按钮,我应该重定向到本地的html文件.
的login.html
<tr>
<td> </td>
<td>
<input type="submit" class="submitbtn" name="submit"
id="submit" value="Login" onclick="loginCheck()">
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
loginValidation.js
if (validCustomer == true) {
alert("valid customer........");
document.location.href("file:///android_asset/www/Category.html");
Run Code Online (Sandbox Code Playgroud)
但document.location.href或window.location/ window.open不起作用.有人可以帮忙解决这个问题吗?如果我使用window.open并在模拟器中运行应用程序它工作正常,但不在设备中.
我最近在想这个,因为Python 3正在print从一个语句变为一个函数.
但是,Ruby和CoffeeScript采用相反的方法,因为你经常从函数中省略括号,从而模糊了关键字/语句和函数之间的区别.(没有括号的函数调用看起来很像关键字.)
一般来说,关键字和函数之间有什么区别?在我看来,一些关键字实际上只是功能.例如,return 3同样可以将其视为return(3)返回函数在语言中本地实现的位置.或者在JavaScript中,typeof是一个关键字,但它看起来非常像一个函数,可以用括号调用.
思考?
我有一个标准的Django Admin页面,用于上传多个文件.我希望做到以下几点:
我现在只有一个非常基本的管理页面.任何人都可以指出我从哪里开始的正确方向?请指出我需要修改哪个文件,因为我仍然不熟悉django.
只是一个简短的方向将不胜感激.谢谢.
我在加载google maps api时遇到了问题.
我用一个初始化地图的函数得到了我自己的对象,谷歌地图api通过jquery.getscript加载.但我总是在回调函数中收到错误消息:
var MyGMap = {
GMapScriptURL: "http://maps.google.com/maps?file=api&v=2&async=2&key=",
Map: null,
Geocoder: null,
InitiazlizeMaps: function () {
if (GBrowserIsCompatible()) {
this.Map = new GMap2(document.getElementById("map_canvas"));
this.Map.setCenter(new GLatLng(37.4419, -122.1419), 13);
this.Geocoder = new GClientGeocoder();
}
}
}
$(function(){
var CurrentKey = "MY_KEY";
$.getScript(MyGMap.GMapScriptURL + CurrentKey, function () {
MyGMap.InitiazlizeMaps();
// throws GMap2 is undefined
});
});
Run Code Online (Sandbox Code Playgroud)
怎么了?为什么这不运行?
我一直在尝试设置Metalsmith的教程,我已经到了第1部分的末尾.
我安装了node.js和模块.IDE是安装了Node.js工具的Visual Studio 2013.我已经放入了一个基本结构,我试图用模板来渲染单个页面.
说明告诉将以下文件放入文件:
---
title: Home
template: home.hbt
---
This is your first page
Run Code Online (Sandbox Code Playgroud)
使用以下模板:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{ title }} | Metalsmith Page</title>
</head>
<body>
<div class="main-wrapper">
{{{ contents }}}
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
该教程说它应该渲染到一个html页面,但我得到的结果是这样的:
--- title: Home template: home.hbt --- This is your first page
Run Code Online (Sandbox Code Playgroud)
当我使用markdown渲染器时,它会给出
<p>---
title: Home</p>
<h2 id="template-home-hbt">template: home.hbt</h2>
<p>This is your first page</p>
Run Code Online (Sandbox Code Playgroud)
调试代码显示,当它到达渲染器时,缺少YAML前端元数据.这似乎很重要,因为插件使用元数据来呈现页面.
javascript ×3
django ×2
html ×2
node.js ×2
c ×1
c# ×1
coffeescript ×1
cordova ×1
css ×1
delay ×1
django-admin ×1
file-upload ×1
fractals ×1
function ×1
google-maps ×1
java ×1
jquery ×1
keyword ×1
linked-list ×1
metalsmith ×1
overflow ×1
python ×1
queue ×1
radix-sort ×1
settimeout ×1