Month: September 2017
$(document).ready(function(){
document.oncontextmenu = function() {return false;};
$(document).mousedown(function(e){
if( e.button == 2 ) {
alert('Right mouse button!');
return false;
}
return true;
});
});
本文:jQuery:绑定鼠标右击事件 Bind event to
主页:http://hemantnegi.github.io/jquery.sumoselect/
项目:https://github.com/HemantNegi/jquery.sumoselect
下载:jquery.sumoselect-master
DEMO: http://hemantnegi.github.io/jquery.sumoselect/sumoselect_demo.html
简单介绍
jquery.sumoselect是一款跨设备、跨浏览器的jQuery下拉列表框插件。该jQuery下拉列表框插件可以单选,也可以多选。它的样式可以通过CSS文件来自定义。它的最大特点是可以跨设备…
Read More
核心代码:
var $tr = $(this).closest('.tr_clone');
var $clone = $tr.clone();
$clone.find(':text').val('');
$tr.after($clone);
实例:
HTML:
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table-data">
<tr>
<td>Name</td>
<td>Location</td>
<td>From</td>
<td>To&…
Read More
什么是localStorage?
在HTML5中,新加入了一个localStorage特性,这个特性主要是用来作为本地存储来使用的,解决了cookie存储空间不足的问题(cookie中每条cookie的存储空间为4k),localStorage中一般浏览器支持的是5M大小,这个在不同的浏览器中localStorage会有所不同
localStorage的优势
1、localStorage拓展了cookie的4K限制
2、localStorage会可以将第一次请求的数据直接存储到本地,这个相当于一个5M大小的针对于前端页面的数据库,相比于cookie可以节约带宽,但是这个却是只有在高版本的浏览器中才支持…
Read More
PHP大批量插入数据库的3种方法和速度对比
这篇文章主要介绍了PHP大批量插入数据库的3种方法和速度对比,3种方法分别使用普通insert语句、insert into语句和事务提交,需要的朋友可以参考下
第一种方法:使用insert into 插入,代码如下:
$params = array(‘value'=>'50′);
set_time_limit(0);
echo date(“H:i:s”);
for($i=0;$i<2000000;$i++){
$connect_mysql->insert($params);
};
echo date(“H:i:s”);
最后显示为:23:25:05 01:…
Read More
项目地址:https://github.com/jmosbech/StickyTableHeaders
下载:StickyTableHeaders-master
实例演示: DEMO.
StickyTableHeaders
So what’s it good for? Well, let’s say you want to display a long list of fairly uniform tabluar data, like stock exchange listings or sport statistics but you don’t want your users to get lost in the…
Read More
在使用phpMyAdmin操作数据库时,首先需要设置mysql的root用户的密码。具体操作参考前一篇博文。设置完mysql的root密码之后,需要对phpMyAdmin的登录进行一些配置。
未经配置的phpMyAdmin很不安全,容易受到攻击,或者根本无法正常使用,phpMyAdmin有3种授权模式:
cookie: 显示一个web登录页面,输入mysql的用户名和密码,然后进入管理界面
http: 显示1个windows登录框,输入mysql的用户名和密码,然和进入管理
config: 把mysql用户名和密码直接填入config.inc.php,不显示登录界面,直接进入管理界面
…
Read More
原代码:
$(document).on("mouseover","td.editable",editable_input);
function editable_input()
{
var $editable_type = $(this).attr('editable_type');
if($editable_type == 'text' || $editable_type == 'textarea')
{
$(this).editable(BASEPATH + "/editable", {
indicator : '<img src="'+BASEURL+'public/assets/indicator.gif" />',
typ…
Read More