Archive

zxdSlider:a new jQuery slider plugin

in jquery , by ZHAO Xudong

ABOUT

I use s3slider plugin for jQuery for a month in my site.since i am just learning javascript,writing a new plugin instead would be a nice training,so i write this slider plugin for jQuery.

HOW TO USE

step1:,download zxdSlider plugin,include jQuery and zxdSlider javascript file in the page.something like

1
2
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"><!--mce:0--></script>
<script src="/js/zxdslider.js" type="text/javascript"><!--mce:1--></script>

step2:html structure like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<div id="zxdslider">
        <span class="slidernav leftnav left">&lt;</span>
                <ul id="zxdsliderContent">
                        <li class="zxdsliderli">
                                <img src="/demo/zxdslider/img/a1.jpg" alt="a1" />
                                <span>
                                        <h2><a href="html5beta.com/category/jquery-2/" rel="bookmark" title="jQuery is sweet!">jQuery is sweet!</a></h2>
                                        <p>jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.</p>
                                </span>
                        </li>
                        <li class="zxdsliderli">
                                <img src="/demo/zxdslider/img/a2.jpg" alt="a2" />
                                <span>
                                        <h2><a href="html5beta.com/category/jquery-2/" rel="bookmark" title="zxdSlider is small!">jQuery is sweet!</a></h2>
                                        <p>jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.</p>
                                </span>
                        </li>
                        <li class="zxdsliderli">
                                <img src="/demo/zxdslider/img/a3.jpg" alt="a3" />
                                <span>
                                        <h2><a href="html5beta.com/category/jquery-2/" rel="bookmark" title="zxdSlider is easy to use!">jQuery is sweet!</a></h2>
                                        <p>jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.</p>
                                </span>
                        </li>
                        <li class="zxdsliderli">
                                <img src="/demo/zxdslider/img/a4.jpg" alt="a4" />
                                <span>
                                        <h2><a href="html5beta.com/category/jquery-2/" rel="bookmark" title="zxdSlider is ?!">jQuery is sweet!</a></h2>
                                        <p>jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.</p>
                                </span>
                        </li>
                </ul>
        <span class="slidernav rightnav right">&gt;</span>
</div> <!-- #zxdslider-->

step3:css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#zxdslider {
        width: 960px;
        height: 262px;
        position: relative;
        overflow: hidden;
        background:#555;
        margin:10px 0px 25px 0px;
        padding:0;
}
#sliderContent {
        width: 880px;/*its  #zxdslider's width - .slidernav's width*/
        padding:0;
        margin:0;
}
.zxdsliderli{
        float: left;//must have this
        position: relative;
        display: none;/*must have this*/
        width:880px;/*its  #zxdslider's width - .slidernav's width*/
        height:262px;
}
.zxdsliderli span {
        position:absolute;/*must have this*/
        right:0;
        font: 13px Arial, Helvetica, sans-serif;
        width:370px;
        color: #ddd;
        display: none;/*must have this*/
        top: 0;
        padding: 10px 13px;
        margin:0 40px 0 0;
}
.zxdsliderli img{
        margin:6px;
}
.zxdsliderli a{
        color:#fff;
}
#zxdslider h2 {
        line-height: 40px;
}
#zxdslider h2 a {
        color: #ddd;
}
.slidernav{
        height:262px;
        width:40px;
        font-size:38px;
        color:transparent;
        line-height:250px;
}
.slidernav:hover{
        cursor:pointer;
}
.rightnav{
        text-align:right;
}
.left{float:left}/*must have this*/
.right{float:right}/*must have this*/

step4:add this javascript which fires the engine!

1
2
3
4
5
<script type='text/javascript'>
$(function($) {
        $("#zxdslider").zxdSlider();
})
</script>

check the zxdslider demo page,you can read more detail from the html souce code.

COPY RIGHT

This script is licensed under Creative Commons Attribution 2.5. So you can use it in all you projects even commercial ones.

BROWSER SUPPORT

as far as i know,it works fine in
ie6,
ie7,
ie8,
ie9,
firefox,
chome,
safari…

KNOWN PROBLEM

there is a bug in Jquery 1.5.0 which will cause slider fail to work,so just avoid using Jquery 1.5.0 if you want to use this plugin
not jquery’s bug.in version 1.1,it is fixed.

UPDATE

ver 1.1 it works fine with jquery 1.5.0 now.thanks to fudge@stackoverflow

DOWNLOAD

1.0

zxdSlider plugin,zipped,you should unzip it yourself

1.1

zxdSlider plugin,zipped,you should unzip it yourself

jQuery • plugin • zxdSlider
TAGS
0 Comments
Leave a respond
13
2010,Dec

A bug may crash safari

in misc , by ZHAO Xudong

test in win7 x64,safari 5.1.2,
a special png Optimized by PngOptimizer.exe in a “XHTML 1.0 Strict” doctype html will crash safari.
other browser,including,firefox 9,chome 15,ie 7,8,9,or safari,firefox and chrome in mac do not have this problem.
here is a demo html
if use html5 doctype “< !DOCTYPE html>“,it will not happen either.

0 Comments
Leave a respond
4
2012,Feb
spacer

WordPress theme:BubbleDream

in html5, wordpress , by ZHAO Xudong
spacer

wordpress-theme-BubbleDream-screenshot

/*
Theme Name: BubbleDream
Author: ZHAO Xudong
Theme URI: html5beta.com/wordpress/wordpress-theme-bubbleDream/
Author URI:html5beta.com
Description:a pure css theme without images at all and with a canvas bubbles animated background;
in a perfect world,there is no ie5,ie6,ie7, or ie8!!!do not work in ie5.6.7.8.!!!
Version: 1.0
Tags: black,blue,white,two-columns,fixed-width
License: GNU General Public License, v2 (or newer)
License URI: www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

Will be avalaivable in a few days

BubbleDream • theme • wordpress
TAGS
1 Comments
Leave a respond
22
2012,Jan

jQuery UI Autocomplete 1.8.16中文输入修正

in jquery , by ZHAO Xudong

找到如下代码

1
2
3
4
5
6
7
8
9
}).bind("blur.autocomplete", function (c) {
                if (!a.options.disabled) {
                    clearTimeout(a.searching);
                    a.closing = setTimeout(function () {
                        a.close(c);
                        a._change(c)
                    }, 150)
                }
            })

改为

1
2
3
4
5
6
7
8
9
10
11
}).bind("blur.autocomplete", function (c) {
                if (!a.options.disabled) {
                    clearTimeout(a.searching);
                    a.closing = setTimeout(function () {
                        a.close(c);
                        a._change(c)
                    }, 150)
                }
            }).bind('input',function (c) {
				a.search(a.item);
			})

这样,输入中文就会立刻搜索了。

Autocomplete • jQuery • 中文
TAGS
0 Comments
Leave a respond
12
2011,Oct

colorful bird

in misc, pics , by ZHAO Xudong

spacer

bird
TAGS
0 Comments
Leave a respond
5
2011,Jul
spacer

wordpress theme: MetroWP

in wordpress , by ZHAO Xudong

/*
Theme Name: MetroWP
Author: ZHAO Xudong
Theme URI: html5beta.com/wordpress/wordpress-theme-MetroWP/
Author URI:html5beta.com
Description:a pure css theme without images at all.Warning:ie6,7 user will see a different layout.
Version: 1.0
Tags: yellow,blue,green,two-columns,fixed-width
License: GNU General Public License, v2 (or newer)
License URI: www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

spacer

screenshot

DOWNLOAD

wordpress.org/extend/themes/metrowp/

MetroWP • theme • wordpress
TAGS
27 Comments
Leave a respond
5
2011,Jul
spacer

Change logo of wordpress theme easyOne

in wordpress , by ZHAO Xudong

if you are a new wordpressER,you may not know how to Change logo of wordpress theme easyOne ,let me give you a little guild.

easyOne theme has a default logo :

spacer

leasyOne-logo

it will show in tag page,achieve page and home page as default post image.
only if you did not set your own featured image.
you can click the “set featured image” button to set your own post image:

spacer

set-featured-image

when after uploading a image ,at the bottom,there is a “set featured image” button too.

spacer

set-featured-image-2

after you set your own featured image,it will replace default.like this:

spacer

use-my-own-logo

and if you want repalce the default logo,upload you own logo.gif to theme/easyOne/images/,replace the default logo.gif.
it will work,and you better use same width and height image as default logo.gif which is 65PX × 65PX

easyOne • featrued image • theme • wordpress
TAGS
0 Comments
Leave a respond
28
2011,Apr
spacer

WordPress theme:cssfever

in wordpress , by ZHAO Xudong
spacer

wordpress-theme-cssfever

/*
Theme Name: cssfever
Author: ZHAO Xudong
Theme URI: html5beta.com/wordpress/wordpress-theme-cssfever/
Author URI:html5beta.com
Description:a pure css theme without images at all.do not work in ie5.6.7.8.
Tags: black,blue,white,two-columns,fixed-width
License: GNU General Public License, v2 (or newer)
License URI: www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
FAQ
1.how to turn off the hover show/hide post content funtion
—find these code in style.css and delete them

1
2
3
#content .hide {
	display: none;
}

—find these code in js/cssfever.js and delete them

1
2
3
4
5
6
7
    $('.show').hover(
        function(){
        $(this).find(".hide").show("normal");
        },
        function(){
        $(this).find(".hide").hide("normal");
        });

—done

DOWNLOAD

wordpress.org/extend/themes/cssfever

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.