Skip to content

Instantly share code, notes, and snippets.

@Megic
Megic / mj_fc.js
Created October 11, 2012 08:32
Js:focus-jquery
//使用jquery
//捕获焦点函数支持input以及textarea标签
Mj_fc("#mjask .ma_t","请输入标题:",'1');
Mj_fc("#mjask textarea","内容字数控制在2-200个字符之间",'2');
function Mj_fc(obj,text,ty){
var sct;
@Megic
Megic / style.css
Created October 12, 2012 01:31
css:min-height
.min-height{min-height:200px; height:auto!important; height:200px;}
/****兼容浏览器的min-height***/
@Megic
Megic / index.html
Created October 12, 2012 06:43
Html:template
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<title>领导班子</title>
<link href="style/base.min.css" rel="stylesheet"/>
<link href="style/style.css" rel="stylesheet"/>
<script src="js/jquery-1.8.1.min.js"></script>
<!--[if lt IE 10]>
@Megic
Megic / index.html
Created October 16, 2012 04:01
Js:Mfocus
<div id="slider" class="fl">
<ul>
<li><a href="#"><img src="style/p1.jpg" alt=""></a><p>惠侨科圣诞晚会获好评</p> </li>
<li><a href="#"><img src="style/p1.jpg" alt=""></a><p>惠侨科圣诞晚会获好评</p></li>
<li><a href="#"><img src="style/p1.jpg" alt=""></a><p>惠侨科圣诞晚会获好评</p></li>
</ul>
<div class="button">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
@Megic
Megic / nr.html
Created October 17, 2012 08:13
CMS:example
//截取标题图片
if(!empty($r[titlepic]))
{
$r[titlepic]=sys_ResizeImg($r[titlepic],610,190,1,'');
$listtemp='***';
}else{
$listtemp='***';
}
//******************灵动标签*********************//
[x:loop={'SELECT * FROM `yixin_mjask` order by `id` desc',10,24,0}]
@Megic
Megic / index.html
Created October 19, 2012 08:12
PHP:SQL&page
//Mysql
***********创建表************
create table `news`(
`id` int(10) NOT NULL auto_increment,
`title` varchar(200) NOT NULL,
`date` date NOT NULL,
`text` text,
unique(`title`),
primary key (`id`)
)engine=innoDB default charset=utf8;
@Megic
Megic / ck_sc.php
Created October 22, 2012 14:00
PHP:image&cookies&session
*************
cookie&session
****************
Setcookie(string name, string value, int expire,string path, string domain, int secure);
其中name是cookie变量名称标识,你在php中将能象使用普通变量名相同来用他引用cookie变量。value是cookie变量的初始值,expire 表示该cookie变量的有效时间单位毫秒;path 为该cookie变量的相关路径;domain 表示cookie变量的网站;secure 则需在 https 的安全传输时才有效。
SetCookie("Cookie", "cookievalue",time()+3600, "/forum", ".php100.com", 1);
****************************************
echo $MyCookie;
echo $CookieArray[0];
echo $_COOKIE["MyCookie"]; //建议使用
@Megic
Megic / 111.html
Created October 29, 2012 02:21
Jquery:float div
function Float(elementId,postion,styleCss){
this.id = elementId;
this.div = $("#"+this.id);
this.scrollTop = 0;
this.screenHeight = window.screen.height-window.screenTop;
this.topPx = rePosition(postion,this);
div.css({"position":"absolute","top":topPx+"px"});
if(arguments.length > 2)
$.each(styleCss,function(i,n){
div.css(i,n);
@Megic
Megic / BUG.text
Created November 9, 2012 04:03
WebBUG:css
css背景平铺补全BUG
解决方法:在width:100%; 后面加个 min-width:**px; 这个长度取于你的网页最低宽度。
@Megic
Megic / main.text
Created November 20, 2012 14:53
Centos:vspdf
安装centos6.2
========================
网络设置 查看ip:ifconfig
1 vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 //指出设备名称
BOOTPROTO=static //启动类型 dhcp为自动获取 自动的修改noboot=yes
BROADCAST=192.168.1.255 //广播地址
HWADDR=00:OC:29:C6:65:4c //硬件Mac地址
IPADDR=192.168.0.2 //IP地址
NETMASK=255.255.255.0 //子网掩码