??xml version="1.0" encoding="utf-8" standalone="yes"?>
This is fresh collection of new jQuery plugins. 10 great solutions: new slider, image gallery, movie, map and many other useful things. Many of the plugins have been created recently in 2011. Download, customize and use its in your projects.
This plugin is content slider and image slideshow. Where you can slide between slides using horizontal, vertical and fade transitions. Also you can have navigation controls, custom behavior (this plugin have very many options). Online demo available here
Using this plugin you can easy slide betweeb slides with any content (Content Slider). Allow to embed quite any content inside slides: text, images, video, tooltips etc. Also can enable thumbnails and more. Online demo available here
Using this plugin you can easy perform necessary actions when you scroll to desired element. Online demo available here
This plugin will allow you to play image sequences. So result will similar real video (it looks like GIF – animation too). Online demo available same page.
Another one UL-LI navigation menu. Online demo available here
Interesting plugin, some kind of navigation system between pages, plus give feeling what you walking through rooms of maze Online demo available here
This plugin show us vector world map (and they promising to add more maps in future). Online demo available here
There is a very serious mistake in picture, Taiwan is a part of China!
Nice looking plugin for webmasters who dreaming to build own game (RPG) website. Online demo available here
This pluging giving us few navigation modes for web applications. Online demo available here
Great looking image gallery with autoplay, descriptions and more.
Hope that our review of fresh jquery plugins was very interesting. Good luck!
xtype Class
基本lgQ?/strong>
box Ext.BoxComponent hҎ(gu)属性的lg
button Ext.Button 按钮
colorpalette Ext.ColorPalette 调色?/p>
component Ext.Component lg
container Ext.Container 容器
cycle Ext.CycleButton
dataview Ext.DataView 数据昄视图
datepicker Ext.DatePicker 日期选择面板
editor Ext.Editor ~辑?/p>
editorgrid Ext.grid.EditorGridPanel 可编辑的表格
grid Ext.grid.GridPanel 表格
paging Ext.PagingToolbar 工具栏中的间?/p>
panel Ext.Panel 面板
progress Ext.ProgressBar q度?/p>
splitbutton Ext.SplitButton 可分裂的按钮
tabpanel Ext.TabPanel 选项面板
treepanel Ext.tree.TreePanel ?/p>
viewport Ext.ViewPort 视图
window Ext.Window H口
工具栏组Ӟ(x)
toolbar Ext.Toolbar 工具?/p>
tbbutton Ext.Toolbar.Button 按钮
tbfill Ext.Toolbar.Fill 文g
tbitem Ext.Toolbar.Item 工具条项?/p>
tbseparator Ext.Toolbar.Separator 工具栏分隔符
tbspacer Ext.Toolbar.Spacer 工具栏空?/p>
tbsplit Ext.Toolbar.SplitButton 工具栏分隔按?/p>
tbtext Ext.Toolbar.TextItem 工具栏文本项
表单?qing)字D늻Ӟ(x)
form Ext.FormPanel Form 面板
checkbox Ext.form.Checkbox checkbox 录入?/p>
combo Ext.form.ComboBox combo 选择?/p>
datefield Ext.form.DateField 日期选择?/p>
field Ext.form.Field 表单字段
fieldset Ext.form.FieldSet 表单字段l?/p>
hidden Ext.form.Hidden 表单隐藏?/p>
htmleditor Ext.form.HtmlEditor html ~辑?/p>
numberfield Ext.form.NumberField 数字~辑?/p>
radio Ext.form.Radio 单选按?/p>
textarea Ext.form.TextArea 区域文本?/p>
textfield Ext.form.TextField 表单文本?/p>
timefield Ext.form.TimeField 旉录入?/p>
trigger Ext.form.TriggerField 触发录入?/p>
ul.demolayout {
list-style-type: none;
float: left;
margin:0px;
padding:0px;
}
ul.demolayout li {
margin: 0 0 0 0;
float: left;
border-bottom:1px solid #515151;
}
.tab{
padding:0 0 2px 0;
height: 160px;
text-align:left;
}
ul.demolayout a {
float: left;
display: block;
padding: 5px 25px;
border-bottom: 0;
color: #515151;
text-decoration: none;
font-size:14px;
font-weight: bold;
}
ul.demolayout a:hover {
background: #eee;
}
ul.demolayout a.active {
background: #515151;
padding-bottom: 5px;
cursor: default;
color:white;
}
.tabs-container {
clear: left;
padding:0px;
}
p.more_details{
padding:2px 2px 2px 2px;
font-size:11px;
}
</style>
</HEAD>
<BODY>
<div id="demo" class="demolayout">
<ul id="demo-nav" class="demolayout">
<li><a class="active" href="#tab1" id="1">zd资讯</a></li>
<li><a class="" href="#tab2" id="2">业态分?lt;/a></li>
<li><a class="" href="#tab3" id="3">商家推荐</a></li>
</ul>
<div class="tabs-container">
<div style="display: block;" class="tab" id="tab1">
<p class="more_details">
zd资讯内容信息
</p>
</div>
<div style="display: none; " class="tab" id="tab2">
<p class="more_details">
业态分布内容信?br />
</p>
</div>
<div style="display: none; " class="tab" id="tab3">
<p id="comment" class="more_details">
商家推荐内容信息
</p>
</div>
</div>
</div>
</BODY>
</HTML>
COMSHARP CMS 写道Q在U编辑内容的时候,那些Z JavaScript 的编辑器帮了(jin)我们大忙Q这些所见即所得(WYSIWYGQ编辑器Q给我们提供?jin)类?Office 的操作体验。如今,M|站内容理pȝQCMSQ和博客pȝ都需要一个这L(fng)~辑器。本文精选了(jin)10个基?JavaScript 的编辑器Q它们有的是Z jQuery 框架Q有点则不是?/p>
功能不是很多Q但很轻量,很灵zR打包后只有6.5K大小?/p>
非常基本的编辑器Q简单ؓ(f)本。打包后只有7K?/p>
单到不能再简单,很容易自׃攏V?/p>
跨浏览器Q开源,Z jQuery。可以很Ҏ(gu)同各U?CMSQ论坛,留言本,博客{系l集成?/p>
Z iframe 对象?/p>
<!-- ################## NON jQUery ################### -->
最l典的基?JavaScript 的编辑器QCOMSHARP CMS 默认的编辑器是q个?/p>
功能非常强大?/p>
Z Yahoo YUIQ简单,但很可靠?/p>
自由的基?nbsp; BSD 许可~辑器,功能完善Q很适合同各U系l集成?/p>
本文原文来源Q?a >http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors
Grails支持一些不同的Ҏ(gu)来生XML和JSON响应。第一个是隐式的通过renderҎ(gu)?
render
Ҏ(gu)可以传递一个代码块来执行标记生成器产生XML
def list = { def results = Book.list() render(contentType:"text/xml") { books { for(b in results) { book(title:b.title) } } } }
q段代码的结果将?x)像q样Q?
<books> <book title="The Stand" /> <book title="The Shining" /> </books>
注意Q当你用标记生成器Ӟ必须心(j)避免命名冲突。例如,q段代码生一个错误:(x)
def list = { def books = Book.list() // naming conflict here render(contentType:"text/xml") { books { for(b in results) { book(title:b.title) } } } }
原因是,q里的一个本地变?code>books企图作ؓ(f)Ҏ(gu)被调用?
render
Ҏ(gu)可以同样被用于输出JSON:
def list = { def results = Book.list() render(contentType:"text/json") { books { for(b in results) { book(title:b.title) } } } }
在这U情况下Q结果就?x)是大致相同的?x)
[ {title:"The Stand"}, {title:"The Shining"} ]
同样的命名冲H危险适用于JSON生成器?
Q译者注Q在此附上对于列?Marshalling)解释Q对函数参数q行打包处理得过E,因ؓ(f)指针{数据,必须通过一定得转换Q才能被另一lg所理解。可以说列集(Marshalling)是一U数据格式的转换Ҏ(gu)。)(j)
Grails同样支持自动列集(Marshalling)领域cMؓ(f)XML通过特定的{换器?
首先Q导?code>grails.converters cdC的控制器QControllersQ中Q?
import grails.converters.*
现在Q你可以使用下列高度易读的语法来自动转换领域cLXMLQ?
render Book.list() as XML
输出l果看上M(x)像下列这P(x)
<?xml version="1.0" encoding="ISO-8859-1"?> <list> <book id="1"> <author>Stephen King</author> <title>The Stand</title> </book> <book id="2"> <author>Stephen King</author> <title>The Shining</title> </book> </list>
一个用{换器的替代方法是使用Grails的codecsҎ(gu)。codecsҎ(gu)提供了(jin)encodeAsXML和encodeAsJSONҎ(gu):
def xml = Book.list().encodeAsXML() render xml
Grails同样支持自动列集(Marshalling)为JSON通过同样的机制。简单替?code>XML ?code>JSON
render Book.list() as JSON
输出l果看上M(x)像下列这P(x)
[ {"id":1, "class":"Book", "author":"Stephen King", "title":"The Stand"}, {"id":2, "class":"Book", "author":"Stephen King", "releaseDate":new Date(1194127343161), "title":"The Shining"} ]
再次作ؓ(f)一U替代,你可以?code>encodeAsJSON辑ֈ相同的效?
new Ajax.Updater(container, url, options);
// make a HTTP request to the specified URL and update the 'container' element.
Note: to only update a div on success, you may optionally substitute a property list for a simply element id (ie {success:’div_name’} instead of ‘div_name’)
Option | Default value | Description |
asynchronous | true | Type of request |
evalScripts | false | When set as “true”, scripts in requested url are evaluated |
method | ‘post’ | Lets you decide whether to use Get or Post for the request to the server |
contentType | ‘application/x-www-form-urlencoded’ | Allows you to set the content-type sent to the server |
encoding | ‘UTF-8’ | Allows you to determine the encoding type information given to the server |
parameters | ’’ | Allows you to attach parameters to your AJAX request. Most common: parameters:Form.serialize(this) |
postBody | ’’ | Specify data to post. Something like: postBody:’thisvar=true&thatvar=Howdy’ How does this differ from parameters? |
username | ’’ | |
password | ’’ | |
requestHeaders | ’’ | Allows you to override the headers, see the Prototype AJAX options for details |
onComplete | ’’ | Function to call on completion of request |
onSuccess | ’’ | Function to call on successful completion of request |
onFailure | ’’ | Function to call on failed request |
onException | ’’ | Function to call on failed request (e.g. attempted cross-site request) |
on + Status Code | ’’ | on404 etc. raise an event when given status code is encountered. |
insertion | None | Instead of inserting the response in the existing content (possibly overwriting it) you can pass a valid Insertion object, such as Insertion.Top, Insertion.Bottom, Insertion.Before or Insertion.After. |
Hint: If you have set evalScripts:true the script you call (the url parameter) must return a header of ‘Content-Type: text/javascript’ else the browser will not execute it.
var oFragment = document.createDocumentFragment();
for (var i = 0; i < aTRs.length; i++) {
oFragment.appendChild(aTRs[i]);
}
oTBody.appendChild(oFragment);
oTable.sortCol = iCol;
}
</script>
</head>
<body>
This is my HTML page. <br>
<table border="1" id="tblSort">
<thead>
<tr>
<th onclick="sortTable('tblSort', 0)" style="cursor:pointer">Last Name</th>
<th onclick="sortTable('tblSort', 1)" style="cursor:pointer">First Name</th>
<th onclick="sortTable('tblSort', 2, 'date')" style="cursor:pointer">Birthday</th>
<th onclick="sortTable('tblSort', 3, 'int')" style="cursor:pointer">Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>7/12/1978</td>
<td>31</td>
</tr>
<tr>
<td>Johnson</td>
<td>Betty</td>
<td>10/15/1977</td>
<td>32</td>
</tr>
<tr>
<td>Henderson</td>
<td>Nathan</td>
<td>02/22/1982</td>
<td>27</td>
</tr>
<tr>
<td>Williams</td>
<td>James</td>
<td>8/19/1980</td>
<td>29</td>
</tr>
<tr>
<td>Gilliams</td>
<td>Michael</td>
<td>5/13/1972</td>
<td>39</td>
</tr>
<tr>
<td>Walker</td>
<td>Matthew</td>
<td>10/19/1981</td>
<td>28</td>
</tr>
</tbody>
</table>
</body>
</html>
function sortTable(sTableID, iCol) {
var oTable = document.getElementById(sTableID);
var oTBody = oTable.tBodies[0];
var colDataRows = oTBody.rows;
var aTRs = new Array;
for (var i = 0; i < colDataRows.length; i++) {
aTRs.push(colDataRows[i]);
}
if (oTable.sortCol == iCol){
aTRs.reverse();
} else {
aTRs.sort(generateCompareTRs(iCol));
}
var oFragment = document.createDocumentFragment();
for (var i = 0; i < aTRs.length; i++) {
oFragment.appendChild(aTRs[i]);
}
oTBody.appendChild(oFragment);
oTable.sortCol = iCol;
}
<BODY>
<p>Move your mouser over the red square.</p>
<div id="div1" style="background-color:red; height:50px; width:50px" onmouseover="showTip(event);" onmouseout="hideTip(event);"><div>
<div id="divTip1" style="background-color:yellow;position:absolute;visibility:hidden;padding:5px">
<span style="font-weight:bold">Custom Tooltip</span><br/>
</div>
</BODY>
</HTML>
<BODY>
<div style ="background-color:blue; color:white; font-weight:bold; padding:10px; cursor:pointer" onclick="toggle('divContent1');">Click Here</div>
<div style="border:3px solid blue; height:100px;padding:10px" id="divContent1">
This is some content to show and hide.
</div>
<div style ="background-color:blue; color:white; font-weight:bold; padding:10px; cursor:pointer" onclick="toggle('divContent2');">Click Here</div>
<div style="border:3px solid blue; height:100px;padding:10px" id="divContent2">
This is some content to show and hide.
</div>
</BODY>
</HTML>
ShowModalDialog函数的功能:(x)
打开一个子H口Qƈ且可与父H口怺传递数据,它与window.open的最大区别就在于由ShowModalDialog打开子窗口后Q父H口不能操作?br />
使用Ҏ(gu)Q?/strong>
vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])
参数说明Q?br />
sURL
必选参敎ͼcdQ字W串。用来指定对话框要显C的文档的URL?br />
vArguments
可选参敎ͼcdQ变?sh)。用来向对话框传递参数。传递的参数cd不限Q包括数l等。对话框通过window.dialogArguments来取得传递进来的参数?br />
sFeatures
可选参敎ͼcdQ字W串。用来描q对话框的外观等信息Q可以用以下的一个或几个Q用分号“;”隔开?br />
dialogHeight 对话框高度,不小于1Q0pxQテQ4中dialogHeight ?dialogWidth 默认的单位是emQ而テQ5中是pxQؓ(f)方便其见Q在定义modal方式的对话框Ӟ用px做单位?br />
dialogWidth: 对话框宽度?br />
dialogLeft: 距离桌面左的距离?br />
dialogTop: L面上的距R?br />
center: {yes | no | 1 | 0 }Q窗口是否居中,默认yesQ但仍可以指定高度和宽度?br />
help: {yes | no | 1 | 0 }Q是否显C帮助按钮,默认yes?br />
resizable: {yes | no | 1 | 0 } QテQ5Q]Q是否可被改变大。默认no?br />
status: {yes | no | 1 | 0 } QIE5+Q:(x)是否昄状态栏。默认ؓ(f)yes[ Modeless]或no [Modal]?br />
scroll:{ yes | no | 1 | 0 | on | off }Q指明对话框是否昄滚动条。默认ؓ(f)yes?br />
参数传递方法:(x)
父窗口向子窗口传递参数采用ShowModalDialog的第2个参数即可,父窗口要获取子窗口传回的参数则可通过ShowModalDialog函数的返回D取?br />
子窗口获取父H口参数的方法ؓ(f)采用子窗口window对象dialogArguments属性获取,例如Q?br />
var a=window.dialogArguments;
子窗口向父窗口返回参数采用window.returnValue属性,如:(x)
window.returnValue=1;
window.close();
比如实现上面问题Q只需要这P(x)
var url = "page.html";
var retValue = window.showModalDialog(url, "newwindow", "dialogWidth:500px;dialogHeight:200px;help:no;resizable:no;scroll:no;status:no");
二、怎样才让在showModalDialog和showModelessDialog的超q接不弹出新H口Q?br /> 在被打开的网里加上<base target="_self">可以了(jin)。这句话一般是攑֜<html>?lt;body>之间的?/p>
三、怎样才刷新showModalDialog和showModelessDialog里的内容Q?br /> 在showModalDialog和showModelessDialog里是不能按F5h的,又不能弹?gu)单。这个只能依靠javascript?jin),以下是相关代码?x)
<body onkeydown="if (event.keyCode==116){reload.click()}">
<a id="reload" href="filename.htm" style="display:none">reload...</a>
filename.htm替换成网늚名字然后它攑ֈ你打开的网里Q按F5可以刷C(jin)Q注意,q个要配?lt;base target="_self">使用Q不然你按下F5?x)弹出新H口的?/p>
四、如何用javascriptx(chng)showModalDialog(或showModelessDialog)打开的窗口?br />
<input type="button" value="关闭" onclick="window.close()">
也要配合<base target="_self">Q不然会(x)打开一个新的IEH口Q然后再x(chng)的?/p>
具体使用办法Q?br /> ?a target="_blank" rel="nofollow">snap|站可以甌CD늱g下Ş式的代码Q?br />
<script defer id="snap_preview_anywhere" type="text/javascript" src="http://spa.snap.com/snap_preview_anywhere.js?ap=1&key=739080a127808f9856fa43a8c91c4d21&sb=1&domain=dimlau.com"></script>
下面说说代码的修改:(x)
1、用默认的代码Q鼠标移动到链接上时昄的效果是带搜索框的,但是可以通过修改代码来去掉搜索框Q先看效果对比:(x)
修改Ҏ(gu)是,获得代码中?strong>sb=1Ҏ(gu)sb=0
2、默认代码效果是面中的所有链接都有鼠标划q时昄~略图效果?/strong>如果你想Ҏ(gu)个特定链接禁用羃略图效果Q可以对该链接加上一个分cL标识Q?br /> 例如链接
<a href="xxxx">xxx</a>Q禁用羃略图的方法是写成
<a href="xxxx" class="snap_nopreview">xxx</a>
通常Q一个页面里大部分链接我们都不想加入~略囄Q所以上q办法有点烦(ch)琐了(jin)?br /> 其实可以通过修改代码中的ap=1?strong>ap=0来ə面的所有链接在默认情况下不昄~略图,q时只有链接写成以下格式的情况下才会(x)有羃略图昄Q?br />
<a class="snap_preview" href="XXX">XXX</a>
对于上述各种情况Q如果链接本w已l有?jin)某个class分类Q比如已l分cMؓ(f)class="123",可以?strong>I格来分隔,q赋予多个class分类Q比?br /> class="123 snap_nopreview"或者class="123 snap_preview"
以上为本人的一点小心(j)得,希望对各位看官有点帮助?br /> --------------------------------------------------------------------------------------------------------
对于我用的MTQ可以对模版中的评论者网站链接Ş式加入一个class="snap_preview"来实现对评论者网站界面的初步预览Q我觉得是个不错的小工具?br />
当然其他E序Q也可以做相应的修改实现该效果。我׃再多说了(jin)?/p>
"^\\d+$" //非负整数Q?font style="BACKGROUND-COLOR: #ffffff">正整?/font> + 0Q?br>"^[0-9]*[1-9][0-9]*$" //正整?/font>
"^((-\\d+)|(0+))$" //?font style="BACKGROUND-COLOR: #ffffff">正整?/font>Q负整数 + 0Q?br>"^-[0-9]*[1-9][0-9]*$" //负整?br>"^-?\\d+$" //整数
"^\\d+(\\.\\d+)?$" //非负点敎ͼ正QҎ(gu) + 0Q?br>"^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$" //正QҎ(gu)
"^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))$" //非正点敎ͼ负QҎ(gu) + 0Q?br>"^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))$" //负QҎ(gu)
"^(-?\\d+)(\\.\\d+)?$" //点?br>"^[A-Za-z]+$" //?6个英文字母组成的字符?br>"^[A-Z]+$" //?6个英文字母的大写l成的字W串
"^[a-z]+$" //?6个英文字母的写l成的字W串
"^[A-Za-z0-9]+$" //由数字和26个英文字母组成的字符?br>"^\\w+$" //由数字?6个英文字母或者下划线l成的字W串
"^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$" //email地址
"^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?$" //url
var months = new Array("一?, "二月", "三月", "四月", "五月", "六月", "七月", "八月", "?ji)?, "十月", "十一?, "十二?);
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var days = new Array("?,"一", "?, "?, "?, "?, "?);
var today;
document.writeln("<div id='Calendar' style='position:absolute; z-index:1; visibility: hidden; filter:\"progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#999999,strength=3)\"'></div>");
function getDays(month, year)
{
//下面的这D代码是判断当前是否是闰q的
if (1 == month)
return ((0 == year % 4) && (0 != (year % 100))) || (0 == year % 400) ? 29 : 28;
else
return daysInMonth[month];
}
function getToday()
{
//得到今天的年,??
this.now = new Date();
this.year = this.now.getFullYear();
this.month = this.now.getMonth();
this.day = this.now.getDate();
}
function getStringDay(str)
{
//得到输入框的q???br /> var str=str.split("-")
this.now = new Date(parseFloat(str[0]),parseFloat(str[1])-1,parseFloat(str[2]));
this.year = this.now.getFullYear();
this.month = this.now.getMonth();
this.day = this.now.getDate();
}
function newCalendar() {
var parseYear = parseInt(document.all.Year.options[document.all.Year.selectedIndex].value);
var newCal = new Date(parseYear, document.all.Month.selectedIndex, 1);
var day = -1;
var startDay = newCal.getDay();
var daily = 0;
if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth()))
day = today.day;
var tableCal = document.all.calendar;
var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear());
for (var intWeek = 1; intWeek < tableCal.rows.length;intWeek++)
for (var intDay = 0;intDay < tableCal.rows[intWeek].cells.length;intDay++)
{
var cell = tableCal.rows[intWeek].cells[intDay];
if ((intDay == startDay) && (0 == daily))
daily = 1;
if(day==daily) //今天Q调用今天的Class
{
cell.style.background='#6699CC';
cell.style.color='#FFFFFF';
//cell.style.fontWeight='bold';
}
else if(intDay==6) //周六
cell.style.color='green';
else if (intDay==0) //周日
cell.style.color='red';
if ((daily > 0) && (daily <= intDaysInMonth))
{
cell.innerText = daily;
daily++;
}
else
cell.innerText = "";
}
}
function GetDate(InputBox)
{
var sDate;
//q段代码处理鼠标点击的情?
if (event.srcElement.tagName == "TD")
if (event.srcElement.innerText != "")
{
sDate = document.all.Year.value + "-" + document.all.Month.value + "-" + event.srcElement.innerText;
eval("document.all."+InputBox).value=sDate;
HiddenCalendar();
}
}
function HiddenCalendar()
{
//关闭选择H口
document.all.Calendar.style.visibility='hidden';
}
function ShowCalendar(InputBox)
{
var x,y,intLoop,intWeeks,intDays;
var DivContent;
var year,month,day;
//var o=document.getElementById(InputBox);
var o=InputBox;
var oid=o.id;
var thisyear; //真正的今q年?br />
if(!oid)oid=o.name;
thisyear=new getToday();
thisyear=thisyear.year;
today = o.value;
if(isDate(today))
today = new getStringDay(today);
else
today = new getToday();
//昄的位|?br /> x=o.offsetLeft;
y=o.offsetTop;
while(o=o.offsetParent)
{
x+=o.offsetLeft;
y+=o.offsetTop;
}
document.all.Calendar.style.left=x+2;
document.all.Calendar.style.top=y+20;
document.all.Calendar.style.visibility="visible";
//下面开始输出日历表?border-color:#9DBAF7)
DivContent="<table border='0' cellspacing='0' style='border:1px solid #0066FF; background-color:#EDF2FC'>";
DivContent+="<tr>";
DivContent+="<td style='border-bottom:1px solid #0066FF; background-color:#C7D8FA'>";
//q?br /> DivContent+="<select name='Year' id='Year' onChange='newCalendar()' style='font-family:Verdana; font-size:12px'>";
for (intLoop = thisyear - 100; intLoop < (thisyear + 2); intLoop++)
DivContent+="<option value= " + intLoop + " " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop + "</option>";
DivContent+="</select>";
//?br /> DivContent+="<select name='Month' id='Month' onChange='newCalendar()' style='font-family:Verdana; font-size:12px'>";
for (intLoop = 0; intLoop < months.length; intLoop++)
DivContent+="<option value= " + (intLoop + 1) + " " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop] + "</option>";
DivContent+="</select>";
DivContent+="</td>";
DivContent+="<td style='border-bottom:1px solid #0066FF; background-color:#C7D8FA; font-weight:bold; font-family:Wingdings 2,Wingdings,Webdings; font-size:16px; padding-top:2px; color:#4477FF; cursor:hand' align='center' title='关闭' onClick='javascript:HiddenCalendar()'>S</td>";
DivContent+="</tr>";
DivContent+="<tr><td align='center' colspan='2'>";
DivContent+="<table id='calendar' border='0' width='100%'>";
//星期
DivContent+="<tr>";
for (intLoop = 0; intLoop < days.length; intLoop++)
DivContent+="<td align='center' style='font-size:12px'>" + days[intLoop] + "</td>";
DivContent+="</tr>";
//?br /> for (intWeeks = 0; intWeeks < 6; intWeeks++)
{
DivContent+="<tr>";
for (intDays = 0; intDays < days.length; intDays++)
DivContent+="<td onClick='GetDate(\"" + oid + "\")' style='cursor:hand; border-right:1px solid #BBBBBB; border-bottom:1px solid #BBBBBB; color:#215DC6; font-family:Verdana; font-size:12px' align='center'></td>";
DivContent+="</tr>";
}
DivContent+="</table></td></tr></table>";
document.all.Calendar.innerHTML=DivContent;
newCalendar();
}
function isDate(dateStr)
{
var datePat = /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/;
var matchArray = dateStr.match(datePat);
if (matchArray == null) return false;
var month = matchArray[3];
var day = matchArray[5];
var year = matchArray[1];
if (month < 1 || month > 12) return false;
if (day < 1 || day > 31) return false;
if ((month==4 || month==6 || month==9 || month==11) && day==31) return false;
if (month == 2)
{
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day==29 && !isleap)) return false;
}
return true;
}
#imgTitle_up
{
LEFT: 0px; HEIGHT: 1px; TEXT-ALIGN: left
}
#imgTitle_down
{
LEFT: 0px; TEXT-ALIGN: right
}
.imgClass
{
BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; BORDER-BOTTOM: gray 0px solid
}
#txtFrom
{
VERTICAL-ALIGN: middle; TEXT-ALIGN: center
}
.button
{
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: #7b7b63; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: bold 9px sans-serif; BORDER-LEFT: #fff 1px solid; PADDING-TOP: 0px; TEXT-DECORATION: none;width:20;
}
A.button
{
COLOR: #ffffff; FONT-FAMILY: sans-serif; BACKGROUND-COLOR: #000000; TEXT-DECORATION: none
}
A.button:link
{
COLOR: #ffffff; FONT-FAMILY: sans-serif; BACKGROUND-COLOR: #000000; TEXT-DECORATION: none
}
A.button:visited
{
COLOR: #ffffff; FONT-FAMILY: sans-serif; BACKGROUND-COLOR: #000000; TEXT-DECORATION: none
}
A.button:hover
{
BACKGROUND: #fff; COLOR: #fff; FONT-FAMILY: sans-serif; TEXT-DECORATION: none
}
.buttonDiv
{
BACKGROUND: #000000; FLOAT: left; VERTICAL-ALIGN: middle; WIDTH: 21px; HEIGHT: 1px; TEXT-ALIGN: center
}
.trans
{
FILTER: progid:DXImageTransform.Microsoft.Alpha(startX=0, startY=0, finishX=100, finishY=100,style=1,opacity=0,finishOpacity=40); WIDTH: 90px; BACKGROUND-COLOR: #000
}
</STYLE>
<SCRIPT language="javascript" type="text/javascript">
var imgWidth=199; //囄?br /> var imgHeight=180; //囄?br /> var textFromHeight=0; //焦点字框高度 (单位为px)
var textStyle="f12"; //焦点字class style (不是q接class)
var textLinkStyle="p1"; //焦点字连接class style
var buttonLineOn="#f60"; //button下划Uon的颜?br /> var buttonLineOff="#000"; //button下划Uoff的颜?br /> var TimeOut=5000; //每张囑ֈ换时?(单位毫秒);
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var imgAlt=new Array();
var adNum=0;
//焦点字框高度样式?开?br /> document.write('<style type="text/css">');
document.write('#focuseFrom{width:'+(imgWidth+2)+';margin: 0px; padding:0px;height:'+(imgHeight+textFromHeight)+'px; overflow:hidden;}');
document.write('#txtFrom{height:'+textFromHeight+'px;line-height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}');
document.write('#imgTitle{width:'+imgWidth+';top:-'+(textFromHeight+18)+'px;height:18px}');
document.write('</style>');
document.write('<div id="focuseFrom">');//sx1123
//焦点字框高度样式?l束
<%
//囄新闻
nmm_al = nmm_scIndex.getPicNews(430,5);
if(nmm_al!=null&&!nmm_al.isEmpty())
{
for(int i=0;i < nmm_al.size();i++)
{
Element e = (Element)nmm_al.get(i);
String picUrl = (e.getLink().equals("")?"/nry.jsp?ID=" + e.getID():e.getLink());
out.print("imgUrl["+(i+1)+"]='/Upload/"+e.getElse()+"';");
out.print("imgtext["+(i+1)+"]='<center><a href=\""+ picUrl+"\" TARGET=\"_blank\" class=\"p1\" title="+ e.getTitle() +">"+nmm_scIndex.getSubString(e.getTitle(),30)+"</a></center>';");
out.print("imgLink["+(i+1)+"]='"+picUrl+"';");
out.print("imgAlt["+(i+1)+"]='"+e.getTitle()+"';");
}
}
%>
function changeimg(n)
{
adNum=n;
window.clearInterval(theTimer);
adNum=adNum-1;
nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
//NetScape开?br /> if (navigator.appName == "Netscape")
{
document.write('<style type="text/css">');
document.write('.buttonDiv{height:4px;width:21px;}');
document.write('</style>');
function nextAd(){
if(adNum<(imgUrl.length-1))adNum++;
else adNum=1;
theTimer=setTimeout("nextAd()", TimeOut);
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgAlt[adNum];
document.getElementById('focustext').innerHTML=imgtext[adNum];
document.getElementById('imgLink').href=imgLink[adNum];
document.getElementById("imgtext").innerHTML=imgtext[adNum];//////////////////
}
document.write('<a id="imgLink" href="'+imgLink[1]+'" target=_blank class="p1"><img src="'+imgUrl[1]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=1 alt="'+imgAlt[1]+'" class="imgClass"></a><div id="txtFrom"><span id="focustext" class="'+textStyle+'">'+imgtext[1]+'</span></div>')//sx1123
document.write('<div id="imgTitle">');
document.write('<div id="imgTitle_down">');
//数字按钮代码开?br /> for(var i=1;i<imgUrl.length;i++){document.write('<a href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'">'+i+'</a>');}
//数字按钮代码l束
document.write('</div>');
document.write('</div>');
document.write('</div>');
nextAd();
}
//NetScapel束
//IE开?br /> else
{
var count=0;
for (i=1;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[i]!="") ) {
count++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
//imgInit.filters.revealTrans.Transition=23;
//imgInit.filters.revealTrans.apply();
}
var key=0;
function nextAd(){
if(adNum<count)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgAlt[adNum];
document.getElementById('link'+adNum).style.background=buttonLineOn;
for (var i=1;i<=count;i++)
{
if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
}
focustext.innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd()", TimeOut);
document.getElementById("imgtext").innerHTML=imgtext[adNum];//////////////////
}
document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+' height='+imgHeight+' border=0 vspace="0" name=imgInit class="imgClass"></a>');
document.write('<div id="txtFrom"><span id="focustext" class="'+textStyle+'"></span></div>');
document.write('<div id="imgTitle">');
document.write(' <div id="imgTitle_down"> <a class="trans"></a>');
//数字按钮代码开?br /> for(var i=1;i<imgUrl.length;i++)
{
document.write('<a id="link'+i+'" href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'" onFocus="this.blur()">'+i+'</a>');
}
//数字按钮代码l束
document.write('</div>');
document.write('</div>');
document.write('</div><table><tr><td height=6></td></tr></table>');
document.write("<div id='imgtext'></div>");//////////////////
}
//IEl束
</SCRIPT>
二、【编?E)】菜单中的命令的实现
〖全选〗命令的实现
[格式]:document.execCommand("selectAll")
[说明]选种|页中的全部内容Q?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=document.execCommand("selectAll")>全?lt;/a>
三、【查?V)】菜单中的命令的实现
1、〖刷新〗命令的实现
[格式]:location.reload() ?history.go(0)
[说明]览器重新打开本页?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=location.reload()>h</a>
或加?<a href="#" onclick=history.go(0)>h</a>
2、〖源文g〗命令的实现
[格式]:location.replace("view-source:"+location)
[说明]查看该网늚源代码?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=location.replace("view-source:"+location)>查看源文?lt;/a>
3、〖全屏显C〗命令的实现
[格式]:window.open(document.location,"url","fullscreen")
[说明]全屏昄本页?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=window.open(document.location,"url","fullscreen")>全屏昄</a>
四、【收?A)】菜单中的命令的实现
1、〖添加到收藏夏V命令的实现
[格式]:window.external.AddFavorite('url', '“|站?#8221;)
[说明]本|加到收藏夏V?
[举例]?lt;body></body>之间加入Q?
<a href="Java script:window.external.AddFavorite('http://oh.jilinfarm.com', '胡明新的个h主页')">d到收藏夹</a>
2、〖整理收藏夹〗命令的实现
[格式]:window.external.showBrowserUI("OrganizeFavorites",null)
[说明]打开整理收藏夹对话框?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=window.external.showBrowserUI("OrganizeFavorites",null)>整理收藏?lt;/a>
五、【工?T)】菜单中的命令的实现
〖internet选项〗命令的实现
[格式]:window.external.showBrowserUI("PrivacySettings",null)
[说明]打开internet选项对话框?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=window.external.showBrowserUI("PrivacySettings",null)>internet选项</a>
六、【工h】中的命令的实现
1、〖前q〗命令的实现
[格式]history.go(1) ?history.forward()
[说明]览器打开后一个页面?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=history.go(1)>前进</a>
或加?<a href="#" onclick=history.forward()>前进</a>
2、〖后退〗命令的实现
[格式]:history.go(-1) ?history.back()
[说明]览器返回上一个已览的页面?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=history.go(-1)>后退</a>
或加?<a href="#" onclick=history.back()>后退</a>
3、〖刷新〗命令的实现
[格式]:document.reload() ?history.go(0)
[说明]览器重新打开本页?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=location.reload()>h</a>
或加?<a href="#" onclick=history.go(0)>h</a>
七、其它命令的实现
〖定时关闭本H口〗命令的实现
[格式]:settimeout(window.close(),关闭的时?
[说明]关闭本H口?
[举例]?lt;body></body>之间加入Q?
<a href="#" onclick=settimeout(window.close(),3000)>3U关闭本H口</a>
如果大家q整理出其他用javascript实现的命令,不妨投稿来和大家分n?
【附】ؓ(f)?jin)方便读者,下面列出所有实例代码,你可以把它们攑ֈ一个html文g中,然后预览效果?
<a href="#" onclick=document.execCommand("open")>打开</a><br>
<a href="#" onclick=location.replace("view-source:"+location)>使用 C?~辑</a><br>
<a href="#" onclick=document.execCommand("saveAs")>另存?sh)?lt;/a><br>
<a href="#" onclick=document.execCommand("print")>打印</a><br>
<a href="#" onclick=window.close();return false)>关闭本窗?lt;/a><br>
<a href="#" onclick=document.execCommand("selectAll")>全?lt;/a><br>
<a href="#" onclick=location.reload()>h</a> <a href="#" onclick=history.go(0)>h</a><br>
<a href="#" onclick=location.replace("view-source:"+location)>查看源文?lt;/a> <br>
<a href="#" onclick=window.open(document.location,"url","fullscreen")>全屏昄</a> <br>
<a href="Java script:window.external.AddFavorite('http://homepage.yesky.com', '天极|页陶吧')">d到收藏夹</a> <br>
<a href="#" onclick=window.external.showBrowserUI("OrganizeFavorites",null)>整理收藏?lt;/a> <br>
<a href="#" onclick=window.external.showBrowserUI("PrivacySettings",null)>internet选项</a> <br>
<a href="#" onclick=history.go(1)>前进1</a> <a href="#" onclick=history.forward()>前进2</a><br>
<a href="#" onclick=history.go(-1)>后退1</a> <a href="#" onclick=history.back()>后退2</a><br>
<a href="#" onclick=settimeout(window.close(),3000)>3U关闭本H口</a><br>
"打开,另存?sh)?属?打印"{?4个JS代码
http://www.weiw.com 2003-8-19 伟网动力
■打开?
<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■另存(sh)ؓ(f)?
<input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存?sh)?gt;<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■属性■
<input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属?gt;<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■打印■
<input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■页面设|■
<input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=面讄><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■刷新■
<input type=button value=h name=refresh onclick="window.location.reload()">
■导入收藏■
<input type="button" name="Button" value="导入收藏? onClick=window.external.ImportExportFavorites(true,);>
■导出收藏■
<input type="button" name="Button3" value="导出收藏? onClick=window.external.ImportExportFavorites(false,);>
■加入收藏■
<INPUT name=Button2 onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏?gt;
■整理收藏夹?
<INPUT name=Submit2 onclick="window.external.ShowBrowserUI(OrganizeFavorites, null)" type=button value=整理收藏?gt;
■查看原文g?
<INPUT name=Button onclick=window.location = "view-source:" + window.location.href type=button value=查看源文?gt;
■语a讄?
<INPUT name=Button onclick="window.external.ShowBrowserUI(LanguageDialog, null)" type=button value=语言讄>
■前q■
<INPUT name=Submit onclick=history.go(1) type=submit value=前进>
■后退?
<INPUT name=Submit2 onclick=history.go(-1) type=submit value=后退>