我想通过在页面上的任何位置滚动来触发带有溢出内容的 div 的滚动,而不仅仅是通过移动鼠标并在 div 内单击。另外,我想隐藏 div 的滚动条,以便只有页面的滚动条可见。
解决方案最好是基于 CSS 的,但 JS 解决方案也可以。
这是我的 jsfiddle 演示了这个问题:http : //jsfiddle.net/trpeters1/RMZsX/8/
我会在这里复制代码,但在那里我放了一堆填充文本来触发滚动条。
不过,供您参考,我想在滚动页面时滚动的内部 div 的名称有一个id="scrollMeToo".
我正在尝试使用这个非常好的jQuery Blueimp文件上传插件删除文件.
我把这个插件放在我的根目录中,并且能够上传和删除文件没问题.
但是,当我在我的codeigniter应用程序中嵌入此插件时,由于405错误,我不再删除我上传的文件.我已将所有文件夹设置为777只是为了确保这不是问题.
有什么想法吗?这是我的控制台日志:

我想做一个自动填充,如果有人输入"@",他们会被提供一个自动完成的名单.
我正在使用jQueryUI自动完成,我的解决方案(http://jsfiddle.net/aUfrz/22/)唯一的问题是自动完成文本输入需要放在textarea光标位置的顶部,而不是就目前而言.
这是我在JSFiddle中的JS:
$(document.body).on('keypress', 'textarea', function(e) {
var names = [
"johnny",
"susie",
"bobby",
"seth"
],
$this=$(this),
char = String.fromCharCode(e.which);
if(char == '@') {
console.log('@ sign pressed');
var input=$('<input style="position:relative; top:0px; left:0px;background:none;border:1px solid red" id="atSign" >');
$this.parent().append(input);
input.focus();
input.autocomplete({
source: names,
select: function (event, ui) {
console.log('value selected'+ui.item.value);
//$this.val('@'+ui.item.value);
$this.insertAtCaret(ui.item.value);
$this.focus();
input.remove();
} //select
}); //autocomplete
} //if
}); // keypress
Run Code Online (Sandbox Code Playgroud)
HTML:
<textarea></textarea>?
Run Code Online (Sandbox Code Playgroud)
请注意,我没有在这里显示一个jQuery插件,我曾经在插入位置插入所选的自动完成建议:insertAtCaret()我在其他SO问题中找到了.
PJAX的文档指出Github上使用$.pjax.submit()在提交要点的形式.Github很好地实现的ajax表单提交的一个理想特性是URL从表单重定向action到新创建的URL(在这种情况下,一个包含新服务器端创建的gist ID).
例如,从这个:
https://gist.github.com/gists // form action
Run Code Online (Sandbox Code Playgroud)
对此:
https://gist.github.com/tim-peterson/5019589 //assume this ID is generated server side
Run Code Online (Sandbox Code Playgroud)
我已经让这个在我的网站上工作类似(即,页面本身重定向到相当于https://gist.github.com/tim-peterson/5019589),但我不能重定向URL(它保持像https://gist.github.com/gists).
这完全是服务器端问题(设置标题?)还是pjax中有什么东西我缺少?我正在使用我今天下载的pjax版本,因此我不能使用pjax的buggier版本.
我想知道是否有人可以提供各种原理/解决方案来了解何时从数据库中删除记录,而不是在读取操作期间通过字段值(例如 )简单地隐藏它们is_hidden=1。
我的应用程序是社交网络/电子商务网络应用程序。我倾向于赞成该is_hidden策略,但随着网站的增长,我可以看到这会导致网站性能非常糟糕。
这是我的清单。我缺少清单上的哪些项目?列表的优先级是否良好?
Delete:
DELETEis_hidden:
CREATE数据有用DELETE如果有必要的话可以稍后再做吗SELECT ... WHERE is_hidden!=1想法?
<!DOCTYPE html>
<html>
<head>
<title>DropBox Chooser Example</title>
</head>
<body>
<div id="main">
<input type="dropbox-chooser" name="selected-files" data-link-type="direct" id="db-chooser"/>
<div id="content"></div>
</div>
<script type="text/javascript" src="https://www.dropbox.com/static/api/1/dropins.js" id="dropboxjs" data-app-key="YOUR-APP-KEY"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.tools.min.js"></script>
<script type="text/javascript" src="jquery-layout.js"></script>
<script type="text/javascript">
$(function(){
var dbChooser = $("#db-chooser");
dbChooser.on("DbxChooserSuccess", function(e) {
// Here we will listen when a file is
// chosen from dropbox, insert it into the page
// and initialize the Jcrop plugin
e = e.originalEvent;
var name = e.files[0].name;
});
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我尝试实现Dropbox选择器的示例代码.我创建了一个应用程序,我确实传递了应用程序密钥.我遇到的错误是, …
我的应用程序通过我的 mac 上的 nginx 在本地主机端口 80 上运行了很长一段时间。最近我做了一些软件更新,并试图在不同的端口上运行其他应用程序,现在我无法在 localhost:80 上运行我的第一个应用程序。
我对从哪里开始感到非常困惑,但认为这是基于以下内容的防火墙问题:
Tims-MacBook-Pro-2:html TimPeterson$ telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
Run Code Online (Sandbox Code Playgroud)
指向浏览器http://localhost给出这个Oops! Google Chrome could not connect to localhost
想法?
当我尝试从实时服务器https://mysite.comFailed network error下载 zip 文件时,我的浏览器(Chrome 和 Firefox)中出现以下错误:
令人困惑的是,使用本地主机上的实时服务器中的相同代码(如下)可以让我成功下载相同的 zip 文件:
$path=$data['path_new']='uploads/some-path/';
$file_name='test.zip';
$file=$path.$file_name;
header("Content-Disposition: attachment; filename=".$file_name);
header("Content-Type: application/octet-stream");
readfile($file);
Run Code Online (Sandbox Code Playgroud)
我在本地主机和实时服务器上使用 PHP 和 NGINX,我相信配置相同,但显然我的实时站点上有些问题。有人可以帮忙吗?
我无法让默认的 Bootstrap-TagsInput confirmKeys(即enter=13或comma= 188)开箱即用。不管有没有Typeahead.js都是如此。确认键允许您通过单击该键来创建标签。
我认为问题在于标签是字符串还是对象。如果您查看Tagsinput 演示,您会发现“Typeahead”示例允许使用默认的confirmKeys,enter或来创建标签comma,但其正下方的“Objects as Tags”示例则不允许。
知道如何confirmKeys使用对象标签进行工作吗?
javascript ×7
jquery ×4
php ×3
codeigniter ×2
css ×2
html ×2
nginx ×2
database ×1
delete-file ×1
download ×1
dropbox ×1
file-upload ×1
firewall ×1
geolocation ×1
google-maps ×1
jquery-ui ×1
localhost ×1
macos ×1
overflow ×1
pjax ×1
pushstate ×1
scroll ×1
scrollbar ×1
sql ×1
typeahead.js ×1
zip ×1