??xml version="1.0" encoding="utf-8" standalone="yes"?>色狠狠一区二区三区,在这里有精品,亚洲午夜精品在线http://www.aygfsteel.com/sealyu/category/43220.html--- The devil's in the Detailszh-cnFri, 09 Jul 2010 23:43:04 GMTFri, 09 Jul 2010 23:43:04 GMT60JQuery中常用的Calender和DatePickerlghttp://www.aygfsteel.com/sealyu/archive/2010/07/07/325414.htmlsealsealTue, 06 Jul 2010 20:44:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/07/07/325414.htmlhttp://www.aygfsteel.com/sealyu/comments/325414.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/07/07/325414.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/325414.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/325414.html1?a >Full Calendar

fullcalendar

2、jCal

jcal036

3?a >jQuery Week Calendar

weekcalendar

4?a >jMonthCalendar

jmonthcalendar

5?a >Date Picker

datepicker





seal 2010-07-07 04:44 发表评论
]]>
14个基于jQuery的图片展C和qȝ片插Ӟ转)http://www.aygfsteel.com/sealyu/archive/2010/05/18/321223.htmlsealsealMon, 17 May 2010 18:03:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/05/18/321223.htmlhttp://www.aygfsteel.com/sealyu/comments/321223.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/05/18/321223.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/321223.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/321223.htmlD

有时候,囄的效果胜q千a万字Q这是毫无疑问的Q如CNNQESPNQ它们都是用了大规模的照片qȝ片放|在头版。这是一个非常有效的吸引观众 注意的方法?/p>

所以,从这里。你可以感受?4个以jQuery为基的图片展C所带来的感受?/p>

1.jQuery Cycle

Website | Demo


jquery-cycle

jQuery Cycle


2.Pikachoose

 Website | Demo

Pikachoose

Pikachoose

3.s3Slider

 Website | Demo

s3Slider

s3Slider

4.Galleria

 Website | Demo

Galleria

Galleria

5.slideViewer

 Website | Demo

slideViewer

slideViewer

6.Image Flow

Website | Demo

Image Flow

Image Flow

7.jQuery Gallery Scroller

  Website | Demo

jQuery Gallery Scroller

jQuery Gallery Scroller

8.Spacegallery

 Website | Demo

Spacegallery

Spacegallery

9.Easy Slider

 Website | Demo

Easy Slider

Easy Slider

10.jFlow

Website | Demo

jFlow

jFlow

11.Supersized

 Website | Demo

Supersized

Supersized

12.Simple jQuery Slideshow

 Website | Demo

Simple jQuery Slideshow

Simple jQuery Slideshow

13.CrossSlide

  Website | Demo

CrossSlide

CrossSlide

14.Innerfade

Website | Demo

Innerfade

Innerfade

l束

希望大家会喜Ƣ这个集? :smile:



seal 2010-05-18 02:03 发表评论
]]>
15个用jQuery实现囄qȝ片效果的JS源码(?http://www.aygfsteel.com/sealyu/archive/2010/05/18/321222.htmlsealsealMon, 17 May 2010 18:02:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/05/18/321222.htmlhttp://www.aygfsteel.com/sealyu/comments/321222.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/05/18/321222.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/321222.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/321222.htmljQuery作ؓ一个应用最q泛的JavaScript框架之一Q第三方开发者不断地为其开发出新的 jQuery 插g应用Q从而得jQuery可以帮助用户实现各种各样不同d?Web 效果Q作为最怋用的囄qȝ片效果更是jQuery的强,看完本文Z整理推荐?5个优U的jQuery囄qȝ?d效果Q你会收h多?/p>

15个优U的jQuery囄qȝ?d效果Q基本都已经包含了原插g的发布地址、用方法和源代码下载?/p>

1QGallerific

Galleriffic 是? Mike Alsup ?jQuery Cycle plugin 创徏的图片展C效果,包括~略图、图片标题和描述{详l功能,是一个非怸错的高质量画廊相册展C工兗?/p>

2QZoomImage

zoomimage Q以一U独具魅力的方式展示囄效果。羃略图链接在本弹出大图,q且可以可以随意拖拽该?zhn)图片?/p>

3QEasySlider

Easy Slider 可以实现囄或其他Q意内容,在水qx垂直方向上的滑动效果Q你q可以通过 CSS 自定义设|样式?/p>

4QThe Slider from Barack Obama’s website

一个源自美国ȝ Barack Obama |站的垂下滑动菜单控制的囄qȝ效果?/p>

5QCodaSlider

CodaSliderQ? 又一个不错的滑动控制效果?/p>

6QjQuery Slider II

jQuery Slider II 的布局非常W合操作习惯Q在底部列出带滚动条的羃略图控制列表Q然后在上面昄对应囄的大图浏览,非常适合做高U相册?/p>

7QBeautiful Slider

Beautiful SliderQ? 光看q个效果图你q道这个插件有多棒了吧Q是的,q个插g实现的效果已l不逊色于Flash完成的效果,整体表现畅Q文字显C效果更是创意独牏V?/p>

Q,LoopedSlider

loopedSlider是又一个Q意内Ҏ(gu)? 切换的灯片插gQ用操作简单?/p>

9QSpaceGallery

Accessible news slider

SpaceGallery是一个全新的jQuery插gQ点d 前图片,会自动放大消失,同时后面的图片向前展C,有一U时光机器的感觉?/p>

10QjQuery Popeye

11QNoobslide

Noobslide

12QAccessible News Slider

Accessible news slider

13QSmoothGallery

SmoothGallery

SmoothGallery是一个最好的 Javascript qȝ片效果之一Q可以实现各U不同的qȝ片{换效果?/p>

14QjQuery Multimedia Portfolio

jQuery Multimedia Portfolio

jQuery Multimedia Portfolio是一个基于jQuery 的滑动效果插?除了可以展示囄之外Q还可以加入各种不同cd的多媒体文g?/p>

15Qs3Slider

s3Slider是一个非常简单实用的畅qȝ片效果,q个 插g被应用在无数的WordPress专业主题模板中?/p>

seal 2010-05-18 02:02 发表评论
]]>
35个夺人眼球的jquery菜单下蝲Q{Q?/title><link>http://www.aygfsteel.com/sealyu/archive/2009/12/29/307643.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Tue, 29 Dec 2009 07:57:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2009/12/29/307643.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/307643.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2009/12/29/307643.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/307643.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/307643.html</trackback:ping><description><![CDATA[<small>2009q?6?5?by: Ken </small> <p><strong>菜单</strong>一直在|站中扮演着重要的角Ԍ它好比现实生zM的\标,没有它,我们会恍惚的q失方向?/p> <p>如果像目前的<strong><a >设计?/a></strong> 一P因ؓ分类不算很多Q所以没有注重菜单的变换设计。但是,作ؓ一个大型网站或者想要酷炫风格的设计者而言Q制作出好的菜单Q也是迈向成功的一步。下面的菜单不仅仅风格夺人眼球,而且可以大大节约有限的网站空间?/p> <p>在这个资源共享的C会Q尤其网l体现的淋漓致。不必要花太多时间去琢磨代码Q有了这<strong>35个夺人眼球的菜单</strong>帮助你,你就潜心的研I它的表现Ş式吧?/p> <ul> <li> <h2>1.<a style="cursor: pointer;" target="_blank">jQuery Tabbed Interface / Tabbed Structure Menu Tutorial</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-761="" title="001jquery-tabbed-interface" src="http://shejikuang.com/wp-content/uploads/2009/06/001jquery-tabbed-interface.jpg" alt="001jquery-tabbed-interface" width="570" height="238" /></a></strong></p> <p><a style="cursor: pointer;" target="_blank">Preview </a>|| <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>2.<a style="cursor: pointer;" target="_blank">Animated Menus Using jQuery</a></h2> </li> </ul> <p><strong> <a ><img size-full="" wp-image-762="" title="002jquery-animated-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/002jquery-animated-menu.jpg" alt="002jquery-animated-menu" width="570" height="100" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>3<a style="cursor: pointer;" target="_blank">Create a Cool Animated Navigation with CSS and jQuery (Tutorial + Download)</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-763="" title="003jquery-navigation-slide" src="http://shejikuang.com/wp-content/uploads/2009/06/003jquery-navigation-slide.jpg" alt="003jquery-navigation-slide" width="570" height="160" /></a> </strong></p> <p><strong><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></strong></p> <ul> <li> <h2>4.<a style="cursor: pointer;" target="_blank">jQuery ListNav Plugin</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-764="" title="004jquery-list-nav" src="http://shejikuang.com/wp-content/uploads/2009/06/004jquery-list-nav.jpg" alt="004jquery-list-nav" width="570" height="143" /></a> </strong></p> <p><strong><a style="cursor: pointer;" target="_blank">Preview </a>|| <a style="cursor: pointer;" target="_blank">Download</a></strong></p> <ul> <li> <h2>5. <a style="cursor: pointer;" target="_blank">jqDock menu</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-765="" title="005jqdock-jquery-plugin-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/005jqdock-jquery-plugin-menu.jpg" alt="005jqdock-jquery-plugin-menu" width="474" height="303" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2> 6.<a style="cursor: pointer;" target="_blank">Sliding Jquery Menu</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-766="" title="006jquery-sliding-menu-tutplus" src="http://shejikuang.com/wp-content/uploads/2009/06/006jquery-sliding-menu-tutplus.jpg" alt="006jquery-sliding-menu-tutplus" width="570" height="131" /></a> </strong></p> <p><strong><a ><img size-full="" wp-image-767="" title="007vertical-sliding-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/007vertical-sliding-menu.jpg" alt="007vertical-sliding-menu" width="570" height="167" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <h2>7.<a style="cursor: pointer;" target="_blank">CSS Sprites 2 – It’s JavaScript Time</a></h2> <p><strong><a ><img size-full="" wp-image-768="" title="008css-sprites-2-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/008css-sprites-2-jquery.jpg" alt="008css-sprites-2-jquery" width="570" height="110" /></a></strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> </p> <ul> <li> <h2> 8. <a style="cursor: pointer;" target="_blank">CSS Mac Dock Menu</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-769="" title="009css-dock-menu-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/009css-dock-menu-jquery.jpg" alt="009css-dock-menu-jquery" width="549" height="120" /></a> </strong></p> <p> <a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>9.<a style="cursor: pointer;" target="_blank">Kwicks for jQuery</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-770="" title="010kwicks-jquery-menu-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/010kwicks-jquery-menu-navigation.jpg" alt="010kwicks-jquery-menu-navigation" width="570" height="104" /></a> </strong></p> <p> <a style="cursor: pointer;" target="_blank">7 Examples</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>10.<a style="cursor: pointer;" target="_blank">Jquery File Tree</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-771="" title="011jquery-file-tree-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/011jquery-file-tree-navigation.jpg" alt="011jquery-file-tree-navigation" width="570" height="180" /></a> </strong></p> <p> <a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>11.<a style="cursor: pointer;" target="_blank">Learning jQuery: Fading Menu – Replacing Content</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-772="" title="012menu-fader-jquery-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/012menu-fader-jquery-navigation.jpg" alt="012menu-fader-jquery-navigation" width="570" height="145" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>12. <a style="cursor: pointer;" target="_blank">How to Make a Smooth Animated Menu with jQuery</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-773="" title="013smooth-animated-jquery-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/013smooth-animated-jquery-menu.jpg" alt="013smooth-animated-jquery-menu" width="570" height="160" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>13.<a style="cursor: pointer;" target="_blank">Create Vimeo-like top navigation </a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-774="" title="014create-vimeo-like-top-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/014create-vimeo-like-top-navigation.jpg" alt="014create-vimeo-like-top-navigation" width="570" height="136" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> + <a style="cursor: pointer;" target="_blank">Vimeo site</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>14. <a style="cursor: pointer;" target="_blank">jQuery (mb)Menu 2.3</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-775="" title="015jquery-mb-menu-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/015jquery-mb-menu-navigation.jpg" alt="015jquery-mb-menu-navigation" width="570" height="190" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>15. <a style="cursor: pointer;" target="_blank">Coda Slider</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-776="" title="016coda-slider-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/016coda-slider-jquery.jpg" alt="016coda-slider-jquery" width="570" height="245" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>16. <a style="cursor: pointer;" target="_blank">jQuery idTabs</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-777="" title="017idtabs-jquery-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/017idtabs-jquery-navigation.jpg" alt="017idtabs-jquery-navigation" width="570" height="102" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>17. <a style="cursor: pointer;" target="_blank">Create a Slick Tabbed Content Area using CSS & jQuery</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-778="" title="018slick-tabbed-content-area-css-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/018slick-tabbed-content-area-css-jquery.jpg" alt="018slick-tabbed-content-area-css-jquery" width="570" height="197" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a></p> <ul> <li> <h2>18. <a style="cursor: pointer;" target="_blank">LavaLamp for jQuery lovers!</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-779="" title="019lava-lamp-jquery-navigation" src="http://shejikuang.com/wp-content/uploads/2009/06/019lava-lamp-jquery-navigation.jpg" alt="019lava-lamp-jquery-navigation" width="570" height="79" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>19. <a style="cursor: pointer;" target="_blank">Animated Drop Down Menu with jQuery</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-780="" title="020animated-dropdown-menu-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/020animated-dropdown-menu-jquery.jpg" alt="020animated-dropdown-menu-jquery" width="570" height="199" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>20. <a style="cursor: pointer;" target="_blank">Using jQuery for Background Image Animations</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-781="" title="021jquery-background-image-animations" src="http://shejikuang.com/wp-content/uploads/2009/06/021jquery-background-image-animations.jpg" alt="021jquery-background-image-animations" width="570" height="75" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a></p> <ul> <li> <h2>21. <a style="cursor: pointer;" target="_blank">How To Create A ‘Mootools Homepage’ Inspired Navigation Effect Using jQuery</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-782="" title="022mootools-homepage-navigation-effect" src="http://shejikuang.com/wp-content/uploads/2009/06/022mootools-homepage-navigation-effect.jpg" alt="022mootools-homepage-navigation-effect" width="570" height="239" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>22. <a style="cursor: pointer;" target="_blank">Menumatic Mootools</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-783="" title="023menumatic-vertical-menu-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/023menumatic-vertical-menu-jquery.jpg" alt="023menumatic-vertical-menu-jquery" width="570" height="324" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview Vertical</a> || <a style="cursor: pointer;" target="_blank">Preview horizontal </a>|| <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>23. <a style="cursor: pointer;" target="_blank">jQuery convertion: Garagedoor effect using Javascript</a> </h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-784="" title="024garage-door-jquery-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/024garage-door-jquery-menu.jpg" alt="024garage-door-jquery-menu" width="570" height="181" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>24. <a style="cursor: pointer;" target="_blank">Perspective tabs</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-785="" title="025perspective-tabs-mootools-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/025perspective-tabs-mootools-menu.jpg" alt="025perspective-tabs-mootools-menu" width="570" height="255" /></a> </strong></p> <ul> <li> <h2> 25. <a style="cursor: pointer;" target="_blank">Fisheye Menu</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-786="" title="026fisheye-menu-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/026fisheye-menu-jquery.jpg" alt="026fisheye-menu-jquery" width="570" height="203" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>26. <a style="cursor: pointer;" target="_blank">Sliding JavaScript Menu Highlight 1kb</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-787="" title="027sliding-javascript-menu-highlight" src="http://shejikuang.com/wp-content/uploads/2009/06/027sliding-javascript-menu-highlight.jpg" alt="027sliding-javascript-menu-highlight" width="570" height="106" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>27. <a style="cursor: pointer;" target="_blank">Mootools Demo Redux</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-788="" title="028mootools-demo-redux" src="http://shejikuang.com/wp-content/uploads/2009/06/028mootools-demo-redux.jpg" alt="028mootools-demo-redux" width="570" height="117" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a></p> <ul> <li> <h2>28. <a style="cursor: pointer;" target="_blank">HoverAccordion</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-789="" title="029hover-accordion-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/029hover-accordion-jquery.jpg" alt="029hover-accordion-jquery" width="570" height="325" /></a></strong></p> <ul> <li> <h2> 29. <a style="cursor: pointer;" target="_blank">Simple Javascript Accordions</a></h2> </li> </ul> <p><strong> <a ><img size-full="" wp-image-790="" title="030simple-javascript-accordion-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/030simple-javascript-accordion-jquery.jpg" alt="030simple-javascript-accordion-jquery" width="468" height="193" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>30. <a style="cursor: pointer;" target="_blank">UvumiTools Dropdown Menu </a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-791="" title="031uvumi-tools-dropdown-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/031uvumi-tools-dropdown-menu.jpg" alt="031uvumi-tools-dropdown-menu" width="570" height="161" /></a> </strong></p> <ul> <li> <h2> 31. <a style="cursor: pointer;" target="_blank">Create a multilevel Dropdown menu with CSS and improve it via jQuery</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-792="" title="032multilevel-dropdown-menu-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/032multilevel-dropdown-menu-jquery.jpg" alt="032multilevel-dropdown-menu-jquery" width="490" height="117" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>32. <a style="cursor: pointer;" target="_blank">jQuery & CSS Example – Dropdown Menu</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-793="" title="033jquery-css-example-dropdown-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/033jquery-css-example-dropdown-menu.jpg" alt="033jquery-css-example-dropdown-menu" width="510" height="183" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a></p> <ul> <li> <h2>33. <a style="cursor: pointer;" target="_blank">Floating menu jQuery&CSS</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-794="" title="034live-floating-menu-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/034live-floating-menu-jquery.jpg" alt="034live-floating-menu-jquery" width="231" height="203" /></a> </strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>34. <a style="cursor: pointer;" target="_blank">Superfish – jQuery menu plugin</a></h2> </li> </ul> <p><strong><a ><img size-full="" wp-image-795="" title="035superfish-examples-jquery" src="http://shejikuang.com/wp-content/uploads/2009/06/035superfish-examples-jquery.jpg" alt="035superfish-examples-jquery" width="415" height="186" /></a></strong></p> <p><a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <ul> <li> <h2>35. <a style="cursor: pointer;" target="_blank">JQuery Pager</a></h2> </li> </ul> <p><strong> <a ><img size-full="" wp-image-796="" title="036jquery-pager-menu" src="http://shejikuang.com/wp-content/uploads/2009/06/036jquery-pager-menu.jpg" alt="036jquery-pager-menu" width="417" height="139" /></a></strong></p> <p>  <a style="cursor: pointer;" target="_blank">Preview</a> || <a style="cursor: pointer;" target="_blank">Download</a></p> <img src ="http://www.aygfsteel.com/sealyu/aggbug/307643.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2009-12-29 15:57 <a href="http://www.aygfsteel.com/sealyu/archive/2009/12/29/307643.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ZjQuery的facebox使用http://www.aygfsteel.com/sealyu/archive/2009/12/25/307262.htmlsealsealFri, 25 Dec 2009 06:46:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/12/25/307262.htmlhttp://www.aygfsteel.com/sealyu/comments/307262.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/12/25/307262.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/307262.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/307262.html它是什?
facebox是一个jquery为基的lightboxQ可昄囑փQ?divs Q或者远E页面?它的使用单,Ҏ(gu)。下载j(lu)sQ请查看例子Q然后开始n受faceboxl我们带来的乐趣?

首先我们用Facebox观看囄 Q?/font>
<a href="cssrain.jpg" rel="facebox">text</a>
仅仅q样O(jin)K?br />
然后我们在来?用Facebox观看div  Q?/font>
<a href="#info" rel="facebox">text</a>
ok,p样就能简单的实现facebox了?br />
当然在ajax横行的时代,ajaxq程加蝲面也是必不可少的?br /> 我们用Facebox加蝲q程的页面内容:
<a href="cssrain.html" rel="facebox">text</a>
OKQ这样就能远E加?cssrain.html 的内容,以facebox的方式显CZ?br />
q是FamSpam 上的截图

用法Q?/font>
facebox应该导入
<script src="jquery.js" type="text/javascript"></script>
<link href="/facebox/facebox.css" _fcksavedurl=""/facebox/facebox.css"" media="screen" rel="stylesheet" type="text/css"/>
<script src="/facebox/facebox.js" type="text/javascript"></script>
jQuery(document).ready(function($) {
//链接的rel属性是否具有facebox
  $('a[rel*=facebox]').facebox()
})

演示
演示

下蝲
你需要在js和css里面 加上 loading囄Q和四个角的囄和边框图片?q就是你要做的?
Download Facebox v1.0


深入研究
http://famspam.com/facebox/

感谢 & 联系
感谢Facebook的理念和风格。感谢Mindy Tchieu她在工作中对我的帮助?

facebox作者Email: chris@ozmm.org

译作者Email: cssrain@gmail.com  Blog:http://www.cssrain.cn

摘自【http://bbs.blueidea.com/thread-2822886-1-1.html?

seal 2009-12-25 14:46 发表评论
]]>
jquery和prototype冲突解决 (?http://www.aygfsteel.com/sealyu/archive/2009/12/23/307070.htmlsealsealWed, 23 Dec 2009 12:52:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/12/23/307070.htmlhttp://www.aygfsteel.com/sealyu/comments/307070.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/12/23/307070.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/307070.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/307070.html问题背景: 想用 jQuery ?AJAX 处理, 用基?Prototype ?EasyValidation 做表单验? 但是二者不能共? 因ؓ都用了同一个方法名: $().

解决:

jquery和prototype冲突解决, |上传的一文?我这里测试结果是错误? http://ajaxbbs.net/blog/post/71/

另一U方式是:
<script type=”text/javascript”>
      jQuery.noConflict();
</script>

参? http://www.d5s.cn/archives/6, 但我q里试也有问题!

本h试通过的方?

1、将jquery.js攑ֈprototype.js前面Q这个是必须?Q?br /> 2、在jquery.js后面?变量重命名?br /> Ҏ(gu)如下Q?

<script type="text/javascript"  src="jquery.js"></script>
<script type="text/javascript">
var jQuery=$;
</script>

<script type="text/javascript" type="text/javascript" src="window.js"></script>
<!--上面q个window.js调用了jquery框架的方?->
<script type="text/javascript" type="text/javascript" src="prototype.js"></script>

3、将原来使用?Ҏ(gu)名一律替换ؓjQuery名,?("obj")替换为jQuery("obj")?

例如下面的一D代? 混合?jQuery和基于Prototype?EasyValidation:

<!--  jquery, 注意加蝲序 -->
<script src="js/jquery-1.2.6.pack.js"></script>
<script type=”text/javascript”>
      var jQuery=$;
</script>

<!-- 表单验证 -->
<script src="easy_validation/lib/prototype.js" type="text/javascript"></script>
<script src="easy_validation/lib/effects.js" type="text/javascript"></script>
<script src="easy_validation/src/validation_cn.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="easy_validation/styles/style_min.css" />

    <div id="contents"></div>
  <script>
  jQuery(document).ready(function(){
    //jQuery("#contents").load("test.jsp");
    jQuery("#contents").load("test.jsp?username=BeanSoft")
  });
  </script>
          <!-- 为form增加required-validate class,标识需要验证form -->
        <form id='helloworld' action="#" class='required-validate'>
<input name="user.name" class="required min-length-6 max-length-20 validate-alphanum" value="beansoft">
     *密码:
      <input name="user.password" type="password" class="required min-length-6 max-length-20" value="123456" >

    *密码(重复):
      <input name="password1" type="password" class="required equals-user.password" value="123456" >

            <input type='submit' value='Submit'/>
            <input type='reset' value='Reset'/>
        </form>



seal 2009-12-23 20:52 发表评论
]]>
jquery-validate学习(?http://www.aygfsteel.com/sealyu/archive/2009/12/23/307050.htmlsealsealWed, 23 Dec 2009 08:18:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/12/23/307050.htmlhttp://www.aygfsteel.com/sealyu/comments/307050.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/12/23/307050.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/307050.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/307050.html阅读全文

seal 2009-12-23 16:18 发表评论
]]>
几个jquery验证密码强度的插?/title><link>http://www.aygfsteel.com/sealyu/archive/2009/12/21/306814.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Mon, 21 Dec 2009 08:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2009/12/21/306814.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/306814.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2009/12/21/306814.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/306814.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/306814.html</trackback:ping><description><![CDATA[.<br /> <div> <p>本来是英文版的,我改了一点,提示什么的都是中文的了Q?/p> <p>从这里下?<u><font color="#108ac6"><a href="http://www.aygfsteel.com/Files/sealyu/jquery-pstrength.rar">jquery.pstrength.js</a></font></u> 强度验证插gQ然后在|页中引用jquery文g和这个插?/p> <div> <div>XML/HTML代码</div> <ol> <li><script src="/js/jquery.js" type="text/javascript"></script>       </li> <li><script type="text/javascript" src="/js/jquery.pstrength.js"></script>    </li> </ol> </div> <p>然后使用以下函数</p> <div> <div>JavaScript代码</div> <ol> <li>jQuery(document).ready(function(){        </li> <li>      jQuery('#password1').pstrength();      </li> <li>});     </li> </ol> </div> <p>#password是你的密码框ID</p> <p>Ҏ(gu)你的情况不同Q你可以自定义你的密码强度,我定义的是这L(fng)<br />  </p> <div> <div>JavaScript代码</div> <ol> <li>$.extend($.fn, {    </li> <li>        pstrength: function(options) {    </li> <li>            var options = $.extend({    </li> <li>                verdects: ["很不安全", "不安?, "一?, "安全?, "非常安全"],    </li> <li>                colors: ["#f00", "#c06", "#f60", "#3c0", "#3f0"],    </li> <li>                scores: [10, 15, 30, 40],    </li> <li>                common: ["password", "sex", "god", "123456", "123", "liverpool", "letmein", "qwerty", "monkey"],    </li> <li>                minchar: 6    </li> <li>            }, options);   </li> </ol> </div> <p><span style="color: #ff6600;"><strong> 效果如下Q?/strong></span></p> <p><img alt="" src="http://www.aygfsteel.com/images/blogjava_net/sealyu/c5df55d8-c08f-341a-b9bc-cf251b34ff50.jpg" width="447" height="170" /><br /> </p> <p><br /> </p> <p>2.<br /> </p> <h2>jQuery密码强度验插?/h2> <div> <p><a rel="lightbox[1278]"><img src="http://wlog.com.cn/wp-content/uploads/2009/05/pass_strength.jpg" alt="pass_strength" title="pass_strength" class="alignnone size-full wp-image-1279" width="333" height="49" /></a></p> <p>一ƾ不错的密码强度插gQ?/p> <p>1 <a >jquery.pstrength插g</a>和jquery文g</p> <p>2 载入jquery文g和jquery.pstrength文g</p> <div> <ol ln-show="" title="Double click to hide line number." ondblclick="linenumber(this)"> <li><script type="text/javascript" src="js/jquery.js"></script>  </li> <li><script type="text/javascript" src="js/jquery.pstrength-min.1.2.js"></li> <li></script></li> <li><script type="text/javascript"></li> <li>$(function() {</li> <li> $('#user_password').pstrength();</li> <li>});</li> <li></script></li> </ol> </div> <p>3 HTML加入密码输入框,id=”user_password”:</p> <div> <ol ln-show="" title="Double click to hide line number." ondblclick="linenumber(this)"> <li>密码Q?lt;input type="password" id="user_password" name="user_password" /></li> </ol> </div> <p>4 css:</p> <div> <ol ln-show="" title="Double click to hide line number." ondblclick="linenumber(this)"> <li>.pstrength-minchar {</li> <li>font-size : 10px;</li> <li>}</li> <li>input {</li> <li> width:180px;</li> <li> height:12px;</li> <li> line-height:12px;</li> <li> padding:4px 0px;</li> <li> border: #cfcfcf 1px solid;</li> <li> color: #585858;</li> <li>}</li> </ol> </div> <p><a target="_blank">演示地址</a></p> <p>插g官方地址Q?a target="_blank">Ajax Password Strength Meter Script</a></p> <p><a target="_blank"><br /> </a></p> </div> </div> 3.<br /> <div> <h1><strong>用jquery写了一个简单的密码强度试工具</strong></h1> </div> <p>最q正在用功的学习jQueryQ在琢磨了不别人写的功能之后,也开始尝试着自己开发一些功能。今天我做了一个简单的密码强度试工具?/p> <p>q可功能的作用可以看下面q个截图。我已经在多U浏览器中测试过它了?/p> <img src="http://fanxiaojie.com/attachments/month_0910/2009106204119.png" alt=" " /> <p>闲话不提Q上代码Q?/p> <div> <ol start="1"> <li><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  </li> <li><html xmlns="http://www.w3.org/1999/xhtml">  </li> <li><head>  </li> <li><meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  </li> <li><title>无标题文?lt;/title>  </li> <li><script type="text/javascript" src="common/xheditor/jquery-1.3.2.min.js"></script>  </li> <li><script type="text/javascript" src="jquery.popbox.js"></script>  </li> <li><script type="text/javascript">  </li> <li>$(document).ready(function(){  </li> <li>$("form:eq(0) input:eq(0)").focus();  </li> <li>$("input[type=password][name=password1]").focus(function(){  </li> <li>var position=$(this).offset()  </li> <li>var $pwStrength=$('<div id="pwStrength"></div>').appendTo("body");  </li> <li>$pwStrength.css({"position":"absolute","width":120,"height":12,"left":position.left,"top":position.top+28,"background":"#FFFF80","fontSize":"10px","line-height":"12px","color":"#ffffff"});  </li> <li>$('<span>?lt;/span>').css({"width":26,"height":12,"display":"none","flowover":"hidden","background":"#ff0000","position":"absolute","padding-left":"14px"}).appendTo($pwStrength);  </li> <li>$('<span>?lt;/span>').css({"width":26,"height":12,"display":"none","flowover":"hidden","background":"#FF9900","position":"absolute","padding-left":"54px"}).appendTo($pwStrength);  </li> <li>$('<span>?lt;/span>').css({"width":26,"height":12,"display":"none","flowover":"hidden","background":"#008000","position":"absolute","padding-left":"94px"}).appendTo($pwStrength);  </li> <li>$('<span></span>').css({"width":39,"height":12,"display":"block","flowover":"hidden","position":"absolute","margin-left":"40px","border-left":"1px solid #fff","border-right":"1px solid #fff"}).appendTo($pwStrength);  </li> <li>})  </li> <li>.keyup(function(){var pwd=$(this).val();$("#pwStrength span:lt(3)").css({"display":"none"});  </li> <li>var CharMode=function(iN){if(iN>=48&&iN<=57)return 1;if(iN>=65&&iN<=90)return 2;if(iN>=97&&iN<=122)return 4;else return 8;}  </li> <li>var bitTotal=function(num){modes=0;for (i=0;i<5;i++){if(num & 1) modes++;num>>>=1;}return modes;}  </li> <li>var checkStrong=function (sPW){if(sPW.length<=5)return 0;Modes=0;for (i=0;i<sPW.length;i++){Modes|=CharMode(sPW.charCodeAt(i));   }return bitTotal(Modes);}  </li> <li>if(pwd!=''&&pwd!=null){var level=checkStrong(pwd);if(level==0)$("#pwStrength span:eq(0)").css({"display":"block"});if(level==1)$("#pwStrength span:eq(1)").css({"display":"block"});if(level==2)$("#pwStrength span:eq(2)").css({"display":"block"});}})  </li> <li>.blur(function(){$("#pwStrength").remove()});  </li> <li>})  </li> <li></script>  </li> <li><style type="text/css">  </li> <li>body{font-size:12px;line-height:20px;text-align:left;}  </li> <li>th{text-align:right;color:#336688;font-weight:normal;}  </li> <li>input{border-right:1px solid #e1e5e8;border-bottom:1px solid #e1e5e8;border-left:1px solid #999999;border-top:1px solid #999999;background:#f1f2f3;font-size:12px;line-height:15px;height:17px;color:#666666;padding:1px 2px;}  </li> <li>button{border-left:1px solid #d4d6d8;border-top:1px solid #d4d6d8;border-right:1px solid #666666;border-bottom:1px solid #666666;background:#999999;font-size:12px;line-height:20px;height:20px;padding:0 8px;color:#ffffff;}  </li> <li>button.submit{border-left:1px solid #d4d6d8;border-top:1px solid #d4d6d8;border-right:1px solid #003366;border-bottom:1px solid #003366;background:#336699;font-size:12px;line-height:20px;height:20px;padding:0 8px;color:#ffffff;}  </li> <li></style>  </li> <li></head>  </li> <li><body>  </li> <li><form>  </li> <li><table border="0" cellpadding="3" cellspacing="0">  </li> <li><tr><th><label for="username">误入用户名</label></th><td>  </li> <li><input type="text" name="username" size="19" maxlength="16"/></td></tr>  </li> <li><tr><th><label for="password1">误入密?lt;/label></th><td>  </li> <li><input type="password" name="password1" value="" size="19" maxlength="18" /></td></tr>  </li> <li><tr><th><label for="password2">请再ơ输入密?lt;/label></th><td>  </li> <li><input type="password" name="password2" value="" size="19" maxlength="18" /></td></tr>  </li> <li><tr><th>&nbsp;</th><td><button type="submit" class="submit">提交</button> <button type="reset">重置</button></td></tr>  </li> <li></table>  </li> <li></form>  </li> <li></body>  </li> <li></html>  </li> </ol> </div> <pre style="display: none;" name="code" class="html"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文?lt;/title> <script type="text/javascript" src="common/xheditor/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="jquery.popbox.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("form:eq(0) input:eq(0)").focus(); $("input[type=password][name=password1]").focus(function(){ var position=$(this).offset() var $pwStrength=$('<div id="pwStrength"></div>').appendTo("body"); $pwStrength.css({"position":"absolute","width":120,"height":12,"left":position.left,"top":position.top+28,"background":"#FFFF80","fontSize":"10px","line-height":"12px","color":"#ffffff"}); $('<span>?lt;/span>').css({"width":26,"height":12,"display":"none","flowover":"hidden","background":"#ff0000","position":"absolute","padding-left":"14px"}).appendTo($pwStrength); $('<span>?lt;/span>').css({"width":26,"height":12,"display":"none","flowover":"hidden","background":"#FF9900","position":"absolute","padding-left":"54px"}).appendTo($pwStrength); $('<span>?lt;/span>').css({"width":26,"height":12,"display":"none","flowover":"hidden","background":"#008000","position":"absolute","padding-left":"94px"}).appendTo($pwStrength); $('<span></span>').css({"width":39,"height":12,"display":"block","flowover":"hidden","position":"absolute","margin-left":"40px","border-left":"1px solid #fff","border-right":"1px solid #fff"}).appendTo($pwStrength); }) .keyup(function(){var pwd=$(this).val();$("#pwStrength span:lt(3)").css({"display":"none"}); var CharMode=function(iN){if(iN>=48&&iN<=57)return 1;if(iN>=65&&iN<=90)return 2;if(iN>=97&&iN<=122)return 4;else return 8;} var bitTotal=function(num){modes=0;for (i=0;i<5;i++){if(num & 1) modes++;num>>>=1;}return modes;} var checkStrong=function (sPW){if(sPW.length<=5)return 0;Modes=0;for (i=0;i<sPW.length;i++){Modes|=CharMode(sPW.charCodeAt(i)); }return bitTotal(Modes);} if(pwd!=''&&pwd!=null){var level=checkStrong(pwd);if(level==0)$("#pwStrength span:eq(0)").css({"display":"block"});if(level==1)$("#pwStrength span:eq(1)").css({"display":"block"});if(level==2)$("#pwStrength span:eq(2)").css({"display":"block"});}}) .blur(function(){$("#pwStrength").remove()}); }) </script> <style type="text/css"> body{font-size:12px;line-height:20px;text-align:left;} th{text-align:right;color:#336688;font-weight:normal;} input{border-right:1px solid #e1e5e8;border-bottom:1px solid #e1e5e8;border-left:1px solid #999999;border-top:1px solid #999999;background:#f1f2f3;font-size:12px;line-height:15px;height:17px;color:#666666;padding:1px 2px;} button{border-left:1px solid #d4d6d8;border-top:1px solid #d4d6d8;border-right:1px solid #666666;border-bottom:1px solid #666666;background:#999999;font-size:12px;line-height:20px;height:20px;padding:0 8px;color:#ffffff;} button.submit{border-left:1px solid #d4d6d8;border-top:1px solid #d4d6d8;border-right:1px solid #003366;border-bottom:1px solid #003366;background:#336699;font-size:12px;line-height:20px;height:20px;padding:0 8px;color:#ffffff;} </style> </head> <body> <form> <table border="0" cellpadding="3" cellspacing="0"> <tr><th><label for="username">误入用户名</label></th><td> <input type="text" name="username" size="19" maxlength="16"/></td></tr> <tr><th><label for="password1">误入密?lt;/label></th><td> <input type="password" name="password1" value="" size="19" maxlength="18" /></td></tr> <tr><th><label for="password2">请再ơ输入密?lt;/label></th><td> <input type="password" name="password2" value="" size="19" maxlength="18" /></td></tr> <tr><th>&nbsp;</th><td><button type="submit" class="submit">提交</button> <button type="reset">重置</button></td></tr> </table> </form> </body> </html></pre> <p>你也可以把那Djavascript拿出来放在一个独立的js文g里,然后再链接到|页里也可以的?/p> <p>那个$(document).ready(function(){})里的W一句代码意思是_一载入把光标定位到网中W一个表单的W一个输入项上?/p> <p>然后再找C个输入域inputQtype="password" name="password1"。至所以要q样写,因ؓ在注册页里,往往是有两个密码输入域Q第一个name="password1"W二个名 ?password2"Q用来重复输入密码。另外呢Q在d里也有一个密码输入域Q但是它的name一般是"password"Q而不会是其它。所? 哪怕是|页中每一都插入了这DjsQ它只能在注册页里v作用Q?("input[type=password][name=password1]")? 抓到惌的东ѝ?/p> <p>最q我在啃诅R网重构》这本书Q努力在试提高|页的可L,甚至希望自己做的|页对盲人来说也没有障碍。我发现在把那个“误入用户名” ?lt;label>包v来,q加上for的属性,可以让盲人的d器工作容易。另外,把每个表单的提交按钮的颜色和其它按钮的颜色区分开Q也? 以增加网늚可读性?/p> <img src ="http://www.aygfsteel.com/sealyu/aggbug/306814.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2009-12-21 16:14 <a href="http://www.aygfsteel.com/sealyu/archive/2009/12/21/306814.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>客户端验证的极品--jQuery.validator(?http://www.aygfsteel.com/sealyu/archive/2009/12/21/306791.htmlsealsealMon, 21 Dec 2009 06:31:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/12/21/306791.htmlhttp://www.aygfsteel.com/sealyu/comments/306791.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/12/21/306791.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/306791.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/306791.html最q在做一个用h册登录的面Q资料查寻过E中发现了一个非怸错的客户端验证的极品QjQuery.validate?
它是著名的JavaScript包jQuery的一个插Ӟ其实它还有其它的一些插件应该都爽,有待慢慢来学?

官方地址Qhttp://bassistance.de/jquery-plugins/jquery-plugin-validation/
jQuery用户手册Qhttp://jquery.org.cn/visual/cn/index.xml

开发用v来非常简单明了,
我的代码Q?/p>
   1. $(document).ready(function(){   
   
2.   
   
3/* 讄默认属?nbsp;*/   
   
4. $.validator.setDefaults({   
   
5.   submitHandler: function(form) { form.submit(); }   
   
6. });   
   
7// 中文字两个字?nbsp;  
   8. jQuery.validator.addMethod("byteRangeLength"function(value, element, param) {   
   
9.   var length = value.length;   
  
10.   for(var i = 0; i < value.length; i++){   
  
11.    if(value.charCodeAt(i) > 127){   
  
12.     length++;   
  
13.    }   
  
14.   }   
  
15.   return this.optional(element) || ( length >= param[0&& length <= param[1] );   
  
16. }, "L(fng)保输入的值在3-15个字节之?一个中文字?个字?");   
  
17.   
  
18/* q加自定义验证方?nbsp;*/   
  
19// w䆾证号码验?nbsp;  
  20. jQuery.validator.addMethod("isIdCardNo"function(value, element) {   
  
21.   return this.optional(element) || isIdCardNo(value);   
  
22. }, "h输入?zhn)的n份证L(fng)");   
  
23.   
  
24// 字符验证   
  25. jQuery.validator.addMethod("userName"function(value, element) {   
  
26.   return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);   
  
27. }, "用户名只能包括中文字、英文字母、数字和下划U?/span>");   
  
28.   
  
29// 手机L(fng)验证   
  30. jQuery.validator.addMethod("isMobile"function(value, element) {   
  
31.   var length = value.length;   
  
32.   return this.optional(element) || (length == 11 && /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/.test(value));   
  
33. }, "h填写?zhn)的手机号?/span>");   
  
34.   
  
35// ?sh)话L(fng)验证   
  36. jQuery.validator.addMethod("isPhone"function(value, element) {   
  
37.   var tel = /^(\d{3,4}-?)?\d{7,9}$/g;   
  
38.   return this.optional(element) || (tel.test(value));   
  
39. }, "h填写?zhn)的?sh)话号?/span>");   
  
40.   
  
41// 邮政~码验证   
  42. jQuery.validator.addMethod("isZipCode"function(value, element) {   
  
43.   var tel = /^[0-9]{6}$/;   
  
44.   return this.optional(element) || (tel.test(value));   
  
45. }, "h填写?zhn)的邮政编?/span>");   
  
46. $(regFrom).validate({   
  
47/* 讄验证规则 */   
  
48.   rules: {   
  
49.    userName: {   
  
50.     required: true,   
  
51.     userName: true,   
  
52.     byteRangeLength: [3,15]   
  
53.    },   
  
54.    password: {   
  
55.     required: true,   
  
56.     minLength: 5   
  
57.    },   
  
58.    repassword: {   
  
59.     required: true,   
  
60.     minLength: 5,   
  
61.     equalTo: "#password"   
  
62.    },   
  
63.    question: {   
  
64.     required: true   
  
65.    },   
  
66.    answer: {   
  
67.     required: true   
  
68.    },   
  
69.    realName: {   
  
70.     required: true   
  
71.    },   
  
72.    cardNumber: {   
  
73.     isIdCardNo: true   
  
74.    },   
  
75.    mobilePhone: {   
  
76.     isMobile: true   
  
77.    },   
  
78.    phone: {   
  
79.     isPhone: true   
  
80.    },   
  
81.    email: {   
  
82.     required: true,   
  
83.     email: true   
  
84.    },   
  
85.    zipCode: {   
  
86.     isZipCode:true   
  
87.    }   
  
88.   },   
  
89/* 讄错误信息 */   
  
90.   messages: {   
  
91.    userName: {   
  
92.     required: "请填写用户名",   
  
93.     byteRangeLength: "用户名必d3-15个字W之?一个中文字?个字W?"   
  
94.    },   
  
95.    password: {   
  
96.     required: "请填写密?/span>",   
  
97.     minlength: jQuery.format("输入{0}.")   
  
98.    },   
  
99.    repassword: {   
 
100.     required: "请填写确认密?/span>",   
 
101.     equalTo: "两次密码输入不相?/span>"   
 
102.    },   
 
103.    question: {   
 
104.     required: "请填写?zhn)的密码提C问?/span>"   
 
105.    },   
 
106.    answer: {   
 
107.     required: "请填写?zhn)的密码提C答?/span>"   
 
108.    },   
 
109.    realName: {   
 
110.     required: "请填写?zhn)的真实姓?/span>"   
 
111.    },   
 
112.    email: {   
 
113.     required: "误入一个Email地址",   
 
114.     email: "误入一个有效的Email地址"   
 
115.    }   
 
116.   },   
 
117/* 错误信息的显CZ|?nbsp;*/   
 
118.   errorPlacement: function(error, element) {   
 
119.    error.appendTo( element.parent() );   
 
120.   },   
 
121/* 验证通过时的处理 */   
 
122.   success: function(label) {   
 
123.    // set   as text for IE   
 124.    label.html(" ").addClass("checked");   
 
125.   },   
 
126/* 获得焦点时不验证 */   
 
127.   focusInvalid: false,   
 
128.   onkeyup: false   
 
129. });   
 
130.   
 
131// 输入框获得焦Ҏ(gu)Q样式设|?nbsp;  
 132. $('input').focus(function(){   
 
133.   if($(this).is(":text"|| $(this).is(":password"))   
 
134.    $(this).addClass('focus');   
 
135.   if ($(this).hasClass('have_tooltip')) {   
 
136.    $(this).parent().parent().removeClass('field_normal').addClass('field_focus');   
 
137.   }   
 
138. });   
 
139.   
 
140// 输入框失ȝҎ(gu)Q样式设|?nbsp;  
 141. $('input').blur(function() {   
 
142.   $(this).removeClass('focus');   
 
143.   if ($(this).hasClass('have_tooltip')) {   
 
144.    $(this).parent().parent().removeClass('field_focus').addClass('field_normal');   
 
145.   }   
 
146. });   
 
147. });  


|上的资料有Q它跟prototype包会有冲H,我还没有同时使用q,q点不是很清楚,但我是发C个问题:
对于最?? 长度的验证方法,作者可能考虑到大家的命名习惯不同Q同时做了minLength和minlengthQmaxLength和maxlengthQ方法, 应该哪一个都是可以的Q但对于用户Message来说Q只能够定义针对minlengthQmaxlengthQ,才能调用用户自定义的MessageQ?
否则只是调用包的默认MessageQ但具体原因q没有查清楚。同Ӟq个插g提供了本地化的消息,但对于我q里初学者来_怎么使用它还有待摸烦Q?



seal 2009-12-21 14:31 发表评论
]]>
2009 q度最?jQuery 插g(?http://www.aygfsteel.com/sealyu/archive/2009/12/15/305993.htmlsealsealTue, 15 Dec 2009 02:41:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/12/15/305993.htmlhttp://www.aygfsteel.com/sealyu/comments/305993.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/12/15/305993.html#Feedback4http://www.aygfsteel.com/sealyu/comments/commentRss/305993.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/305993.html

jQuery 是个宝库Q?jQuery 的插件体pL个取之不竭的宝库Q众多开发者在 jQuery 框架下,设计了数不清的插ӞjQuery  的特长是|页效果Q因此,它的插g库也多与 UI 有关。本文是 webdesignledger.com |站推选的2009q度最?jQuery 插g?/p>

拉洋?/h3>

在一个固定区域,循环昄几段内容Q这U方式很像旧时的拉洋片,2009q_q种 Web 效果大行光QjQuery 有大量与此有关的插gQ以下插件无疑是最佳的?/p>

AnythingSlider

jquery plugins

?CSS-Tricks ?Chris Coyier 设计Q功能齐全,应用十分q泛?/p>

Easy Slider

jquery plugins

q个 Content Slider 插g既包含传l?#8220;前后”D模式Q又包含늠式导航?/p>

Coda-Slider 2.0

jquery plugins

Coda-Slider 2.0 是对 Panic Coda |站上对应效果的模仿?/p>

囄?/h3>

那些需要借助 Flash 实现滑动与渐入渐出效果图片库的日子已l去q,借助 jQueryQ这U效果已l可以在本地实现Q以下是本年度备受欢q的几个 jQuery 囄库插件?/p>

Galleria

jquery plugins

q是一个基?jQuery 的图片库Q可以逐个加蝲囄q显C羃略图?/p>

jQuery Panel Gallery

jquery plugins

一个可以高度定义的囄库插Ӟ无需对单个图片进行Q何处理,q个插g会帮你完成一切?/p>

slideViewer

jquery plugins

slideViewer 会检查你的图片列表中的编P动态创建各个图片的늠览D?/p>

Supersized

jquery plugins

一个o人惊讶的囄循环展示插gQ包含各U变换效果和预加载选项Q会对图片自动改变尺总适应览器窗口?/p>

D

我们怿Q作为网站的DpȝQ应该越单,易用越好,然而,假如你确实希望实C些更炫的效果QjQuery 是最好的选项Q以下插件是09q最好的 jQuery  D插g?/p>

jquery mb.menu

jquery plugins

Horizontal Scroll Menu with jQuery

jquery plugins

AutoSprites

jquery plugins

表单和表?/h3>

?Web 设计中,表单和表格都是不是很讨h喜欢的东西,但你不得不面对,本年度出现几个不错的 jQuery  插g帮你完成q些d?/p>

Password Strength

jquery plugins

q个插g帮你评估用户输入的密码是否够强壮?/p>

Ajax Fancy Capcha

jquery plugins

֐思义Q一个支?Ajax 又很炫的 jQuery Captcha 插gQ它使用了很人性化的验证机制?/p>

Chromatable

jquery tables

q个插g可以帮助你在表格上实现滚动条?/p>

jqTransform

jquery plugins

一个式hӞ帮助你对表单中的控gq行式样控制?/p>

Uploadify

jquery plugins

实现多个文g同时上传?/p>

jExpand

jquery tables

一个很轻量?jQuery 插gQ你的表格可以扩展Q在一些商业应用中Q可以让表格更容易组l其中的内容?/p>

本文来源Q?a >http://webdesignledger.com/resources/the-best-jquery-plugins-of-2009



seal 2009-12-15 10:41 发表评论
]]>
Textbox to accept only numbers (digits) using jqueryhttp://www.aygfsteel.com/sealyu/archive/2009/11/06/301471.htmlsealsealFri, 06 Nov 2009 09:46:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/11/06/301471.htmlhttp://www.aygfsteel.com/sealyu/comments/301471.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/11/06/301471.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/301471.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/301471.htmlFew days back, my friend Parleen asked me how can we make a textbox which just accepts only numbers specially digits only. And, for his I come up with this solution of textbox which only accepts digits, and if you try to enter any alpha bates in it then it displays the error message with animation.

View Demo

HTML Code

<input type="text"name="quantity"id="quantity"/><span id="errmsg"></span>

As you can see above, I’ve given the name and id of textbox to “quantity” in this example.This is the textbox which only accepts numbers (digits only). You can see “span” after textbox which is used to display the error message with fading effect using jQuery.

Javascript Code

First of all, we need to use jQuery library as we’re using the jquery’s function to accept only digits.

<script type="text/javascript"src="jquery.js"></script>

Now le’ts write the code in JavaScript using jQuery to accept only digits in textbox and displaying error with animation.

//when key is pressed in the textbox$("#quantity").keypress(function (e)

{

  //if the letter is not digit then display error and don't type anything

  if( e.which!=8&& e.which!=0&&(e.which<48|| e.which>57))

  {

    //display error message

    $("#errmsg").html("Digits Only").show().fadeOut("slow");

    returnfalse;

  }

});

When the key is pressed, we’re using the key’s ASCII value to check which button is pressed. In first expression, delete, tab or backspace button is is checked and “8″ is the ASCII values of the Back-space. Digits are checked in the second expression. “48″ is the ASCII values of “0″ and “57″ is the ASCII values of “9″. The the ASCII values of the other digits lies between “48″ to “57″. And, if the key pressed values doesn’t lies withing these range, then we are displaying the error message with jQuery’s fading effect.

And, the “return false” statement means that this functions returns false values which means not to type anything on the text box.

Download Full Source Code



seal 2009-11-06 17:46 发表评论
]]>
jQuery中文入门指南Q{Q?/title><link>http://www.aygfsteel.com/sealyu/archive/2009/04/17/266157.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Fri, 17 Apr 2009 07:05:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2009/04/17/266157.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/266157.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2009/04/17/266157.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/266157.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/266157.html</trackback:ping><description><![CDATA[<h1>jQuery中文入门指南Q翻译加实例QjQuery的vҎ(gu)E?/h1> <div> <h3>中文版译者:<a >Keel</a></h3> <p>此文以实例ؓ基础一步步说明了jQuery的工作方式。现以中文翻译(d我的补充说明Q如下。如有相x见或?<a href="mailto:keel.sike%28at%29gmail.com">EMAIL</a> 告知。或者在 <a >BLOG</a>中留a?/p> <p>英文原版Q?a >http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery</a> Q感谢原文作?<a >Jörn Zaefferer</a> <strong>本文发布已征求原作者同意?/strong> </p> <p> 说明:在本教程发布之后Q得C几个|友的指正,寚w分内容作了修正,但在jQuery版本不断更新的情况下Q教E中的某些内容已l过Ӟ其?.3? 上版本)Q在忠于原文的基上,我将q部分内容加以标U的补充说明Q希望更多的前端开发者能Ҏ(gu)文提出宝贉|见,谢谢Q?--2009-3-10</p> <p>另外我认为在学习q程?有两个API文档你要打开随时查看:</p> <ul> <li><a target="_blank">http://api.jquery.com/</a> [注:已更Cؓjquery新地址]</li> <li><a target="_blank">http://visualjquery.com/</a></li> </ul> 如果想了解更多jQuery及插件信息,?a >讉K本站首页</a>.</div> <h4>以下部分为原文翻?</h4> <hr /> <div> <h2>jQuery入门指南教程</h2> <p> q个指南是一个对jQuery库的说明Q要求读者了解HTML(DOM)和CSS的一些常识。它包括了一个简单的Hello World的例子,选择器和事g基础QAJAX、FX的用法,以及如何制作jQuery的插件? q个指南包括了很多代码,你可以copy它们Qƈ试着修改它们Q看看生的效果? </p> <h2>内容提要</h2> <ol> <li><a >安装</a></li> <li><a >Hello jQuery</a></li> <li><a >Find me:使用选择器和事g</a></li> <li><a >Rate me:使用AJAX</a></li> <li><a >Animate me(让我生动h):使用FX</a></li> <li><a >Sort me(我有序?:使用tablesorter插g(表格排序)</a></li> <li><a >Plug me:制作(zhn)自q插g</a></li> <li><a >Next steps(下一?</a></li> </ol> </div> <div> <h2 id="setup">安装</h2> <p>一开?我们需要一个jQuery的库,最新的下蝲可以?a >q里</a>扑ֈ。这个指南提供一个基本包含实例的包供下蝲.</p> <p>下蝲Q?a >jQuery Starterkit</a></p> <p> (译者Keel?一定要下蝲q个包,光看文章不实践肯定是不行的? </p> <p>下蝲后解压羃Q然后用你最喜欢的文本编辑器打开starterkit.html和custom.jsq两个文件?译者Keel?q两个就是例子文?所有的例子都用q两个例子作?custom.js写jQuery代码,starterkit.html观察效果.用editPlus打开) </p> <p>现在,我们已l做好了一切准备来q行q个著名?Hello world"例子.</p> <h4>本章的相关链?</h4> <ul> <li><a >Starterkit</a></li> <li><a >jQuery Downloads</a></li> </ul> </div> <div> <h2 id="hello">Hello jQuery</h2> <p>在做所有事情之?我们要让jQueryd和处理文档的DOM,必须可能快地在DOM载入后开始执行事?所?我们用一个ready事g作ؓ处理HTML文档的开?看看我们打开的custom.jsq个文g,里面已经准备好了:</p> <pre>$(document).ready(function() {<br /> <br /> // do stuff when DOM is ready<br /> <br /> });</pre> <p>放一个简单的alert事g在需要等DOM完成载入,所以我们把dE稍变复杂一?在点MQ何一个链接时昄一个alert.</p> <pre>$(document).ready(function() {<br /> <br /> $("a").click(function() {<br /> <br /> alert("Hello world!");<br /> <br /> });<br /> <br /> });</pre> <p>q样在你点击面的一个链接时都会触发q个"Hello world"的提C?/p> <p>(译者Keel?L(fng)此代码修改custom.jsq保?然后用浏览器打开starterkit.html观察效果?</p> <p>让我们看一下这些修Ҏ(gu)什么含义?("a") 是一个jQuery选择?selector),在这里,它选择所有的a标签Q译者Keel注:?lt;a></a>Q,$? ?jQuery “c?#8221;(jQuery "class")的一个别Uͼ因此$()构造了一个新的jQuery 对象(jQuery object)。函?click() 是这个jQuery对象的一个方法,它绑定了一个单M件到所有选中的标{?q里是所有的a标签),q在事g触发时执行了它所提供的alertҎ(gu).</p> <p>q里有一个拟行相似功能的代码:</p> <pre><a href="#" onclick="alert('Hello world')">Link</a></pre> <p>不同之处很明?用jQuery不需要在每个a标签上写onclick事g,所以我们拥有了一个整z的l构文档(HTML)和一个行为文?JS),辑ֈ了将l构与行为分开的目?像我们使用CSSq求的一?</p> <p>下面我们会更多地了解到选择器与事g.</p> <h4>本章的相关链?</h4> <ul> <li><a >jQuery Core</a></li> <li><a >jQuery Selectors</a></li> <li><a >jQuery Events</a></li> </ul> </div> <div> <h2 id="find">Find me:使用选择器和事g</h2> <p>jQuery提供两种方式来选择html? elementsQ第一U是用CSS和Xpath选择器联合v来Ş成一个字W串来传送到jQuery的构造器Q如Q?("div > ul a")Q;W二U是用jQuery对象的几个methods(Ҏ(gu))。这两种方式q可以联合v来؜合用?/p> <p>Z试一下这些选择器,我们来试着在我们starterkit.html中选择q修改第一个ordered list.</p> <p>一开始,我们需要选择q个list本nQ这个list有一个ID?#8220;orderedlist”Q通常的javascript写法是document.getElementById("orderedlist").在jQuery中,我们q样做:</p> <pre>$(document).ready(function() {<br /> <br /> $("#orderedlist").addClass("red");<br /> <br /> });</pre> <p>q里starterkit中的一个CSS样式red附加Corderedlist?译者Keel注:参考测试包中的css目录下的core.cssQ其中定义了red样式)。因此,在你h了starterkit.html后,你将会看到第一个有序列?ordered list )背景色变成了U色Q而第二个有序列表没有变化.</p> <p>现在Q让我们d一些新的样式到l(f)ist的子节点.</p> <pre>$(document).ready(function() {<br /> <br /> $("#orderedlist > li").addClass("blue");<br /> <br /> });</pre> <p>q样Q所有orderedlist中的li都附加了样式"blue"?/p> <p>现在我们再做个复杂一点的Q当把鼠标放在li对象上面和移开时进行样式切换,但只在list的最后一个element上生效?/p> <pre>$(document).ready(function() {<br /> <br /> $("#orderedlist li:last").hover(function() {<br /> <br /> $(this).addClass("green");<br /> <br /> }, function() {<br /> <br /> $(this).removeClass("green");<br /> <br /> });<br /> <br /> });</pre> <p>q有大量的类似的<a title="Documentation for CSS selectors">CSS</a>?a title="Documentation for XPath selectors">XPath</a>例子Q更多的例子和列表可以在<a title="Documentation for base selectors">q里</a>扑ֈ。(译者Keel注:入门看此文,修行在个人,要想在入门之后懂更多Q所以这D话的几个链接迟早是要必看的Q不会又要翻译吧...^_^!Q?/p> <p>每一个onXXX事g都有效,如onclick,onchange,onsubmit{,都有jQuery{h(hun)表示Ҏ(gu)Q译者Keel注:jQuery不喜ƢonXXXQ所以都Ҏ(gu)了XXXQ去掉了onQ?a title="Documentation for advanced events">其他的一些事?/a>Q如ready和hover,也提供了相应的方法?/p> <p>你可以在<a >Visual jQuery</a>扑ֈ全部的事件列表,在Events栏目?</p> <p>用这些选择器和事g你已l可以做很多的事情了Q但q里有一个更强的好东东!</p> <pre>$(document).ready(function() {<br /> <br /> $("#orderedlist").find("li").each(function(i) {<br /> <br /> $(this).html( $(this).html() + " BAM! " + i );<br /> <br /> });<br /> <br /> });</pre> <p>find() 让你在已l选择的element中作条g查找,因此 $("#orderedlist).find("li") 像 $("#orderedlist li")一栗each()Ҏ(gu)q代了所有的liQƈ可以在此基础上作更多的处理?大部分的Ҏ(gu),如addClass(), 都可以用它们自己? each() 。在q个例子? html()用来获取每个li的html文本, q加一些文字,q将之设|ؓli的html文本。(译者Keel注:从这个例子可以看?html()Ҏ(gu)是获取对象的html代码Q?html('xxx')是设|?xxx'为对象的html代码Q?/p> <p>另一个经常碰到的d是在没有被jQuery覆盖的DOM元素上call一些方法,惛_一个在你用AJAX方式成功提交后的resetQ?/p> <pre>$(document).ready(function() {<br /> <br /> // use this to reset a single form<br /> <br /> $("#reset").click(function() {<br /> <br /> $("#form")[0].reset();<br /> <br /> });<br /> <br /> });</pre> <p>Q译者Keel注:q里作者将form的id也写成了formQ源文g?lt;form id="form">Q这是非怸好的写法Q你可以这个IDҎ(gu)form1或者testFormQ然后用$("#form1")? ?("#testForm")来表C它Q再q行试。)</p> <p>q个代码选择了所有ID?form"的元素,q在其第一个上call了一个reset()。如果你有一个以上的formQ你可以q样做:</p> <pre>$(document).ready(function() {<br /> <br /> // use this to reset several forms at once<br /> <br /> $("#reset").click(function() {<br /> <br /> $("form").each(function() {<br /> <br /> this.reset();<br /> <br /> });<br /> <br /> });<br /> <br /> });</pre> <p>Q译者Keel注:h意一定要亲自这些代码写在custom.js中ƈ在starterkit.html上测试效果才能有所体会Q必要时要观察starterkit.html的html代码Q?/p> <p>q样你在点击Reset链接后,选择了文档中所有的form元素Qƈ对它们都执行了一ơreset()?/p> <p>q? 有一个你可能要面对的问题是不希望某些特定的元素被选择。jQuery 提供了filter() 和not() Ҏ(gu)来解册个问题? filter()以过滤表辑ּ来减不W合的被选择? not()则用来取消所有符合过滤表辑ּ的被选择? 考虑一个无序的listQ你惌选择所有的没有ul子元素的li元素?/p> <pre>$(document).ready(function() {<br /> <br /> $("li").not("[ul]").css("border", "1px solid black");<br /> <br /> });</pre> <p>q个代码选择了所有的li元素Q然后去除了没有ul子元素的li元素。刷新浏览器后,所有的li元素都有了一个边框,只有ul子元素的那个li元素例外?/p> <p>Q译 者Keel注:h意体会方便之极的css()Ҏ(gu)Qƈ再次提醒请务必实际测试观察效果,比方说换个CSS样式呢?再加一个CSS样式呢?像这 P$("li").not("[ul]").css("border", "1px solid black").css("color","red");Q?/p> <p>上面代码中的[expression] 语法是从XPath而来Q可以在子元素和属?elements and attributes)上用作过滤器Q比如你可能想选择所有的带有name属性的链接:</p> <pre>$(document).ready(function() {<br /> <br /> $("a[name]").background("#eee"); //原文?#8220;$("a[@name]").background("#eee");”在jQuery1.2及以上版本中,@W号应该去除<br /> <br /> });</pre> <p>q个代码l所有带有name属性的链接加了一个背景色。(译者Keel注:q个颜色太不明显了,写成$("a[name]").background("red");Q?[注:在jQuery1.2及以上版本中,@W号应该去除,下文中不再说明]</p> <p>更常见的情况是以name来选择链接Q你可能需要选择一个有特点href属性的链接Q这在不同的览器下对href的理解可能会不一_所以我们的部分匚w("*=")的方式来代替完全匚w("=")Q?/p> <pre>$(document).ready(function() {<br /> <br /> $("a[href*=/content/gallery]").click(function() {<br /> <br /> // do something with all links that point somewhere to /content/gallery<br /> <br /> });<br /> <br /> });</pre> <p>到现在ؓ止,选择器都用来选择子元素或者是qo元素。另外还有一U情冉|选择上一个或者下一个元素,比如一个FAQ的页面,{案首先会隐藏,当问题点LQ答案显C出来,jQuery代码如下Q?/p> <pre>$(document).ready(function() {<br /> <br /> $('#faq').find('dd').hide().end().find('dt').click(function() {<br /> <br /> var answer = $(this).next();<br /> <br /> if (answer.is(':visible')) {<br /> <br /> answer.slideUp();<br /> <br /> } else {<br /> <br /> answer.slideDown();<br /> <br /> }<br /> <br /> });<br /> <br /> });</pre> <p>q? 里我们用了一些链式表达法来减代码量Q而且看上L直观更容易理解。像'#faq' 只选择了一ơ,利用end()Ҏ(gu)Q第一ơfind()Ҏ(gu)会结?undone)Q所以我们可以接着在后面lfind('dt')Q而不需要再 ?('#faq').find('dt')?/p> <p>在点M件中的,我们?$(this).next() 来找到dt下面紧接的一个dd元素Q这让我们可以快速地选择在被点击问题下面的答案?/p> <p>Q译 者Keel注:q个例子真是太酷了,FAQ中的{案可以收羃Q从利用next()的思\到实现这些效果都有很多地斚w要我们消化,注意 if (answer.is(':visible'))用法Q注意answer.slideUp();不懂的地方赶紧查我在最开始提到的两个必看API文档Q?/p> <p>除了选择同别的元素外,你也可以选择父的元素。可能你惛_用户鼠标Ud文章某段的某个链接时Q它的父U元?-也就是文章的q一D늪出显C,试试q个Q?/p> <pre>$(document).ready(function() {<br /> <br /> $("a").hover(function() {<br /> <br /> $(this).parents("p").addClass("highlight");<br /> <br /> }, function() {<br /> <br /> $(this).parents("p").removeClass("highlight");<br /> <br /> });<br /> <br /> });</pre> <p>试效果可以看到Q移到文章某D늚链接Ӟ它所在的D全用上highlight样式Q移C后又恢复原样?/p> Q译者Keel注:highlight是core.css中定义的样式Q你也可以改变它Q注意这里有W二个function()q是hoverҎ(gu)的特点,请在API文档中查阅hoverQ上面也有例子说明) <p>在我们l之前我们先来看看这一步: jQuery会让代码变得更短从而更Ҏ(gu)理解和维护,下面?(document).ready(callback)的羃写法Q?/p> <pre>$(function() {<br /> <br /> // code to execute when the DOM is ready<br /> <br /> });</pre> <p>应用到我们的Hello world例子中,可以q样:</p> <pre>$(function() {<br /> <br /> $("a").click(function() {<br /> <br /> alert("Hello world!");<br /> <br /> });<br /> <br /> });</pre> <p>现在Q我们手上有了这些基的知识,我们可以更进一步的探烦其它斚w的东西,׃AJAX开始!</p> <h4>本章的相关链?</h4> <ul> <li><a >jQuery API documentation</a></li> <li><a >Visual jQuery - A categorized browsable API documentation</a></li> <li><a >jQuery Expressions: CSS</a></li> <li><a >jQuery Expressions: XPath</a></li> <li><a >jQuery Expressions: Custom</a></li> <li><a >jQuery Special Events</a></li> <li><a >jQuery DOM Traversing</a></li> </ul> </div> <div> <h2 id="rate">Rate me:使用AJAX</h2> <p>在这一部分我们写了一个小的AJAX应用Q它能够rate一些东西(译Keel注:是Ҏ(gu)些东西投)Q就像在youtube.com上面看到的一栗?/p> <p>首先我们需要一些服务器端代码,q个例子中用C一个PHP文gQ读取rating参数然后q回ratingL和^均数。看一?a >rate.php</a>代码.</p> <p>虽然q些例子也可以不使用AJAX来实玎ͼ但显C我们不会那么做Q我们用jQuery生成一个DIV容器QID?rating".</p> <pre>$(document).ready(function() {<br /> <br /> // generate markup<br /> <br /> var ratingMarkup = ["Please rate: "];<br /> <br /> for(var i=1; i <= 5; i++) {<br /> <br /> ratingMarkup[ratingMarkup.length] = "<a href='#'>" + i + "</a> ";<br /> <br /> }<br /> <br /> // add markup to container and applier click handlers to anchors<br /> <br /> $("#rating").append( ratingMarkup.join('') ).find("a").click(function(e) {<br /> <br /> e.preventDefault();<br /> <br /> // send requests<br /> <br /> $.post("rate.php", {rating: $(this).html()}, function(xml) {<br /> <br /> // format result<br /> <br /> var result = [<br /> <br /> "Thanks for rating, current average: ",<br /> <br /> $("average", xml).text(),<br /> <br /> ", number of votes: ",<br /> <br /> $("count", xml).text()<br /> <br /> ];<br /> <br /> // output result<br /> <br /> $("#rating").html(result.join(''));<br /> <br /> } );<br /> <br /> });<br /> <br /> });</pre> <p>q段代码生成?个链接,q将它们q加到id?rating"容器中,当其中一个链接被点击Ӟ该链接标明的分数׃以rating参数形式发送到rate.phpQ然后,l果以XML形式会从服务器端传回来,d到容器中Q替代这些链接?/p> <p>如果你没有一个安装过PHP的webserverQ你可以看看q个<a >在线的例?/a>.</p> <p>不用javascript实现的例子可以访?<a >softonic.de</a> 点击 "Kurz bewerten!"</p> <p>更多的AJAXҎ(gu)可以?a title="Documentation for AJAX methods">q里</a> 扑ֈQ或者看?a >API文档</a> 下面的AJAX filed under AJAX.</p> <p>Q译者Keel注:q个在线实例从国内访问还是比较慢的,点击后要{一会儿才能看到l果Q可以考虑对它q行修改Q比如加上loadingQ投后加上再投的q回链接{。此外,q个例子中还是有很多需要进一步消化的地方Q看不懂的地方请参考API文档。)</p> <p>一个在使用AJAX载入内容时经常发生的问题是:当蝲入一个事件句柄到一个HTML文档Ӟq需要在载入内容上应用这些事Ӟ你不得不在内容加载完成后应用q些事g句柄Qؓ了防止代码重复执行,你可能用到如下一个function:</p> <pre>// lets use the shortcut<br /> <br /> $(function() {<br /> <br /> var addClickHandlers = function() {<br /> <br /> $("a.clickMeToLoadContent").click(function() {<br /> <br /> $("#target").load(this.href, addClickHandlers);<br /> <br /> });<br /> <br /> };<br /> <br /> addClickHandlers();<br /> <br /> });</pre> <p>现在QaddClickHandlers只在DOM载入完成后执行一ơ,q是在用hơ点d有clickMeToLoadContent q个样式的链接ƈ且内容加载完成后.</p> <p>h意addClickHandlers函数是作Z个局部变量定义的Q而不是全局变量(如:function addClickHandlers() {...})Q这样做是ؓ了防止与其他的全局变量或者函数相冲突.</p> <p>另一个常见的问题是关于回?callback)的参数。你可以通过一个额外的参数指定回调的方法,单的办法是将q个回调Ҏ(gu)包含在一个其它的function?</p> <pre>// get some data<br /> <br /> var foobar = ...;<br /> <br /> // specify handler, it needs data as a paramter<br /> <br /> var handler = function(data) {<br /> <br /> ...<br /> <br /> };<br /> <br /> // add click handler and pass foobar!<br /> <br /> $('a').click( function(event) { handler(foobar); } );<br /> <br /> <br /> <br /> // if you need the context of the original handler, use apply:<br /> <br /> $('a').click( function(event) { handler.apply(this, [foobar]); } );</pre> <p>用到单的AJAX后,我们可以认ؓ已经非常?#8220;web2.0”了,但是到现在ؓ止,我们q缺一些酷炫的效果。下一节将会谈到这些效?</p> <h4>本章的相关链?</h4> <ul> <li><a >jQuery AJAX Module</a></li> <li><a >jQuery API: Contains description and examples for append and all other jQuery methods</a></li> <li><a >ThickBox: A jQuery plugin that uses jQuery to enhance the famous lightbox</a></li> </ul> </div> <div> <h2 id="animate">Animate me(让我生动h):使用FX</h2> <p>一些动态的效果可以使用 <code>show()</code> ?<code>hide()</code>来表?</p> <pre>$(document).ready(function() {<br /> <br /> $("a").toggle(function() {<br /> <br /> $(".stuff").hide('slow');<br /> <br /> }, function() {<br /> <br /> $(".stuff").show('fast');<br /> <br /> });<br /> <br /> });</pre> <p>你可以与 <code>animate()</code>联合h创徏一些效?如一个带渐显的滑动效?</p> <pre>$(document).ready(function() {<br /> <br /> $("a").toggle(function() {<br /> <br /> $(".stuff").animate({<br /> <br /> height: 'hide',<br /> <br /> opacity: 'hide'<br /> <br /> }, 'slow');<br /> <br /> }, function() {<br /> <br /> $(".stuff").animate({<br /> <br /> height: 'show',<br /> <br /> opacity: 'show'<br /> <br /> }, 'slow');<br /> <br /> });<br /> <br /> });</pre> <p>很多不错的效果可以访?a >interface plugin collection</a>. q个站点提供了很多demos和文?/p> <p>q些效果插g是位于jQuery插g列表的前面的Q当然也有很多其他的插gQ比如我们下一章讲到的表格排序插g?/p> <h4>本章的相关链?</h4> <ul> <li><a >jQuery FX Module</a></li> <li><a >Interface plugin</a></li> </ul> </div> <div> <h2 id="sort">Sort me(我有序?:使用tablesorter插g(表格排序)</h2> <p>q个表格排序插g能让我们在客L(fng)按某一列进行排序,引入jQuery和这个插件的js文gQ然后告诉插件你惌哪个表格拥有排序功能?/p> <p>要测试这个例子,先在starterkit.html中加上像下面q一行的代码Q?/p> <pre><script src="lib/jquery.tablesorter.js" type="text/javascript"></script></pre> <p>然后可以q样调用不着:</p> <pre>$(document).ready(function() {<br /> <br /> $("#large").tableSorter();<br /> <br /> });</pre> <p>现在点击表格的第一行head区域Q你可以看到排序的效果,再次点击会按倒过来的序q行排列?/p> <p>q个表格q可以加一些突出显C的效果Q我们可以做q样一个隔行背景色Q斑马线Q效?</p> <pre>$(document).ready(function() {<br /> <br /> $("#large").tableSorter({<br /> <br /> stripingRowClass: ['odd','even'], // Class names for striping supplyed as a array.<br /> <br /> stripRowsOnStartUp: true // Strip rows on tableSorter init.<br /> <br /> });<br /> <br /> });</pre> <p>关于q个插g的更多例子和文档可以?<a >tablesorter首页</a>扑ֈ.</p> <p>几乎所有的特g都是q样用的:先include插g的js文g,然后在某些元素上使用插g定义的方?当然也有一些参数选项是可以配|的</p> <p>l常更新的插件列表可以从jQuery官方?<a title="Plugins for jQuery">on the jQuery site</a>扑ֈ.</p> <p>当你更经常地使用jQuery?你会发现你自己的代码打包成插g是很有用处的,它能方便地让你的公司或者其他hq行重用.下一章我们将谈到如何构徏一个自q插g.</p> <h4>本章的相关链?</h4> <ul> <li><a >Plugins for jQuery</a></li> <li><a >Tablesorter Plugin</a></li> </ul> </div> <div> <h2 id="plug">Plug me:制作自己的插?/h2> <p>写一个自qjQuery插g是非常容易的,如果你按照下面的原则来做,可以让其他h也容易地l合使用你的插g.</p> <ol> <li>Z的插件取一个名?在这个例子里面我们叫?foobar".</li> <li>创徏一个像q样的文?jquery.[yourpluginname].js,比如我们创徏一个jquery.foobar.js</li> <li>创徏一个或更多的插件方?使用l承jQuery对象的方?? <pre>jQuery.fn.foobar = function() {<br /> <br /> // do something<br /> <br /> };</pre> </li> <li>可选的:创徏一个用于帮助说明的函数,? <pre>jQuery.fooBar = {<br /> <br /> height: 5,<br /> <br /> calculateBar = function() { ... },<br /> <br /> checkDependencies = function() { ... }<br /> <br /> };</pre> <p>你现在可以在你的插g中用这些帮助函C:</p> <pre>jQuery.fn.foobar = function() {<br /> <br /> // do something<br /> <br /> jQuery.foobar.checkDependencies(value);<br /> <br /> // do something else<br /> <br /> };</pre> </li> <li>可选的l:创徏一个默认的初始参数配置,q些配置也可以由用户自行讑֮,? <pre>jQuery.fn.foobar = function(options) {<br /> <br /> var settings = {<br /> <br /> value: 5,<br /> <br /> name: "pete",<br /> <br /> bar: 655<br /> <br /> };<br /> <br /> if(options) {<br /> <br /> jQuery.extend(settings, options);<br /> <br /> }<br /> <br /> };</pre> <p>现在可以无需做Q何配|地使用插g?默认的参数在此时生效:</p> <pre>$("...").foobar();</pre> <p>或者加入这些参数定?</p> <pre>$("...").foobar({<br /> <br /> value: 123,<br /> <br /> bar: 9<br /> <br /> });</pre> </li> </ol> <p>如果你release你的插g, 你还应该提供一些例子和文档,大部分的插g都具备这些良好的参考文?</p> <p>现在你应该有了写一个插件的基础,让我们试着用这些知识写一个自q插g.</p> <p>很多着控制所有的radio或者checkbox是否被选中,比如:</p> <pre>$("input[type='checkbox']").each(function() {<br /> <br /> this.checked = true;<br /> <br /> // or, to uncheck<br /> <br /> this.checked = false;<br /> <br /> // or, to toggle<br /> <br /> this.checked = !this.checked;<br /> <br /> });</pre> <div>注:在jQuery1.2及以上版本中Q选择所有checkbox应该使用 input:checkbox , 因此以上代码W一行可写ؓ: <br /> $('input:checkbox').each(function() {</div> <p>无论何时候,当你的代码出现eachӞ你应该重写上面的代码来构造一个插?很直接地:</p> <pre>$.fn.check = function() {<br /> <br /> return this.each(function() {<br /> <br /> this.checked = true;<br /> <br /> });<br /> <br /> };</pre> <p>q个插g现在可以q样?</p> <pre>$('input:checkbox').check();<br /> <br /> </pre> <div>注:在jQuery1.2及以上版本中Q选择所有checkbox应该使用 input:checkbox 原文为:$("input[type='checkbox']").check();</div> <p>现在你应该还可以写出uncheck()和toggleCheck()?但是先停一?让我们的插g接收一些参?</p> <pre>$.fn.check = function(mode) {<br /> <br /> var mode = mode || 'on'; // if mode is undefined, use 'on' as default<br /> <br /> return this.each(function() {<br /> <br /> switch(mode) {<br /> <br /> case 'on':<br /> <br /> this.checked = true;<br /> <br /> break;<br /> <br /> case 'off':<br /> <br /> this.checked = false;<br /> <br /> break;<br /> <br /> case 'toggle':<br /> <br /> this.checked = !this.checked;<br /> <br /> break;<br /> <br /> }<br /> <br /> });<br /> <br /> };</pre> <p>q里我们讄了默认的参数,所以将"on"参数省略也是可以?当然也可以加?on","off", ?"toggle",?</p> <pre>$("input[type='checkbox']").check();<br /> <br /> $("input[type='checkbox']").check('on');<br /> <br /> $("input[type='checkbox']").check('off');<br /> <br /> $("input[type='checkbox']").check('toggle');</pre> <p>如果有多于一个的参数讄会稍E有点复?在用时如果只想讄W二个参?则要在第一个参C|写入null.</p> <p>从上一章的tablesorter插g用法我们可以看到,既可以省略所有参数来使用或者通过一?key/value Ҏ(gu)重新讄每个参数.</p> <p>作ؓ一个练?你可以试着?<a >W四?/a> 的功能重写ؓ一个插?q个插g的骨架应该是像这L(fng):</p> <pre>$.fn.rateMe = function(options) {<br /> <br /> var container = this; // instead of selecting a static container with $("#rating"), we now use the jQuery context<br /> <br /> <br /> <br /> var settings = {<br /> <br /> url: "rate.php"<br /> <br /> // put more defaults here<br /> <br /> // remember to put a comma (",") after each pair, but not after the last one!<br /> <br /> };<br /> <br /> <br /> <br /> if(options) { // check if options are present before extending the settings<br /> <br /> $.extend(settings, options);<br /> <br /> }<br /> <br /> <br /> <br /> // ...<br /> <br /> // rest of the code<br /> <br /> // ...<br /> <br /> <br /> <br /> return this; // if possible, return "this" to not break the chain<br /> <br /> });</pre> </div> <div> <h2 id="next">Next steps(下一?</h2> <p>如果你想做更好的javascript开?你用一个叫 <a >FireBug</a>的firefox插g. 它提供了断点调试(比alert强多?、观察DOM变化{很多漂亮的功能</p> <p>如果你还有未解决的问题,或者新的想法与Q你可以使用jQuery的邮件列?<a >jQuery mailing list</a>.</p> <p>关于q个指南的Q何事情,你可以写<a href="mailto:enchos%20%5Bat%5D%20gmx%20%5Bdot%5D%20net">mail</a>l作者或者发表评论在他的日志Q?a >blog</a>.</p> <p>关于q个指南的翻译Q何事情,你可以写<a href="mailto:keel.sike%5Bat%5D%20gmail.com">mail</a>l我.或者在 <a >BLOG</a>中留a.</p> </div> <div> <h3>q有什?..</h3> <p>大大感谢John Resig创造了q么好的library! 感谢jQuery community 为John提供了如此多的咖啡和其他的一?</p> </div> <h4><a >© 2006, Jörn Zaefferer</a> - last update: 2006-09-12</h4> <h4>中文版翻?<a >Keel</a> 上次更新:2006-12-13 -- 最后更? 2009-3-10 <a >讉K本站首页</a></h4> <img src ="http://www.aygfsteel.com/sealyu/aggbug/266157.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2009-04-17 15:05 <a href="http://www.aygfsteel.com/sealyu/archive/2009/04/17/266157.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>强1000个jquery极品插gQ(转)http://www.aygfsteel.com/sealyu/archive/2009/04/16/265940.htmlsealsealThu, 16 Apr 2009 04:45:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/04/16/265940.htmlhttp://www.aygfsteel.com/sealyu/comments/265940.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/04/16/265940.html#Feedback8http://www.aygfsteel.com/sealyu/comments/commentRss/265940.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/265940.html阅读全文

seal 2009-04-16 12:45 发表评论
]]>
վ֩ģ壺 | | ³ľ| ຣʡ| | | Һ| | ɽ| ֶ| | | ͼľ| | ˳| | ̳| | | ɽ| °| ٽ| Ȫ| ʹ| ƽ| ţ| | | | | | | | | ƽ| | | ɽ| | Ϫ| |