jQuery:CSSÒõÓ°¶Ô»°¿ò
jQuery²å¼þ: jquery.widget.shadowbox.js
/**
* Ò»¸ö¼òµ¥µÄÉèÖÃDIVÒõÓ°µÄ²å¼þ
*
* ¹¦ÄÜ:
* 1. ¸ù¾ÝÒõÓ°¿í¶È×Ô¶¯µ÷ÕûÍâ²ãÈÝÆ÷¿í¶È,ÒÔ¼°Í¸Ã÷¶È
* 2. ¿É¶¨ÒåShadowBoxµÄ¿í¶ÈºÍ¸ß¶È
* 3. ¿ÉÓÃCSSÑùʽ±í¶¨Òå¿ÉÊÓ»¯Ñùʽ
*
* @author joe.he <developerworks@163.com>
* @copyright irgs.cn
*/
(function(jQuery) {
jQuery.fn.shadowbox = function(settings) {
var self = this;
// ĬÈÏÉèÖÃ
var defaults = {
shodowWidth: 20,
css: {
outer: 'widget-shadowbox-outer',
shadow: 'widget-shadowbox-shadow',
}
};
if (settings)
jQuery.extend(defaults, settings);
// ÉèÖÃÒõÓ°²ãµÄCSSÑùʽ
var shadow = jQuery("<div>")
.addClass(defaults.css.shadow) // ¹ØÁªÒ»¸öCSSÑùʽ¹æÔò,¿ÉÒÔ×Ô¶¨ÒåÒõÓ°Ñùʽ
.width(self.width())
.height(self.height())
.css({
marginTop:defaults.shodowWidth+"px",
marginLeft:defaults.shodowWidth+"px",
zIndex:-100,
position: "absolute"
});
var outer = jQuery("<div>")
.addClass(defaults.css.outer)
.width(self.outerWidth()+defaults.shodowWidth)
.height(self.outerHeight()+defaults.shodowWidth)
.css({
position: "absolute",
zIndex:999
});
this.prepend(shadow).wrap(outer.get());
// ·µ»ØjQuery¶ÔÏóÓû§Á´Ê½µ÷ÓÃ
return this;
};
})(jQuery);
HTMLÒ³Ãæ: jquery.widget.shadowbox.html
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<mce:script type="text/javascript" src="jquery.js" mce_src="jquery.js"></mce:script>
<mce:script type="text/javascript" src="jquery.widgets.shadowbo
Ïà¹ØÎĵµ£º
CSS ºÍ JavaScript ±êÇ© style ÊôÐÔ¶ÔÕÕ±í£º
ºÐ×Ó±êÇ©ºÍÊôÐÔ¶ÔÕÕ
CSSÓï·¨£¨²»Çø·Ö´óСд£© JavaScriptÓï·¨£¨Çø·Ö´óСд£©
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color bor ......
½ñÌìдÁËÒ»¸ö¼òµ¥µÄÍøÒ³£¬Çë¿´´úÂ룺
´íÎóµÄ£º
HTML´úÂ룺
½ñÌìµÄÈÕ×Ó
//CSS´úÂëʹÓÃÍⲿÒýÈëʽ
ÎҵļÒÏçÔÚ¿Àï
CSS´úÂ룺
/* CSS Document */
body{
font-family:Arial, Helvetica, sans-serif;
font-size:20px;
color:red; /*ÒªµÄ¾ÍÊÇÕâÑùµÄЧ¹û£ºÉèÖÃ×ÖÌåÑÕɫΪºìÉ«*/
}
½á¹ûÏÔʾµÄ×ÖÌ ......
<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="Zend Studio" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery test</title>
</head>
<style>
.lastp{bord ......
.ie
{
border:1px solid #000000;
width:100px;
height:300px;
font-size:12px;
}
.ie div
{ text-over:
overflow:hidden;
text-overflow:ellipsis ......
W3School:http://www.w3school.com.cn/css/index.asp
Ó¢ÎÄ°æÍøÖ·£ºhttp://www.w3schools.com/css/default.asp
×÷Ϊ³õѧÕߣ¬ÕâÊÇÒ»¶¨ÒªÊղصÄÍøÕ¾¡£Õâ¾ÍÏ൱ÓÚÒ»±¾CSSÈëÃŽ̳̣¬ÔÚ´Ë¿ÉÒÔѧϰÿ¸ö±êÇ©£¬ÊôÐÔµÄÓ÷¨ºÍʵÀý£¬¿ÉÒÔ×Ô¶¯¶¯ÊÖʵ¼ù´úÂë¡£³ýÁËCSSµÄ֪ʶ£¬Õâ¸öÍøÕ¾»¹°üÀ¨ÁË´óÁ¿ÆäËûÍøÒ³¿ª·¢ÓïÑԽ̳̺ÍÆäËû֪ʶ¡£
CSS ......