7/24/2555

วิธีทำสไลด์ข่าวเลื่อนๆ หน้าเว็บง่ายๆ ด้วย jQuery

เห็นสไลด์ข่าวหน้าแรกในโซนไอทีไหมครับ
ที่เลื่อนๆวนไปวนมา

ผมไปเจอมาครับ ชื่อเครื่องมือว่า jQuery Plugin Easy Slider Version 1.7
ติดตั้งและใช้งานง่ายดีครับ มีให้เลือก 3 แบบด้วยกัน ดูตัวอย่างได้ ลิงค์ด้านล่างครับ

http://cssglobe.com/lab/easyslider1.7/01.html
http://cssglobe.com/lab/easyslider1.7/02.html
http://cssglobe.com/lab/easyslider1.7/03.html


ดาวน์โหลด และศึกษาวิธีการใช้ได้ที่
http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider

อยากให้ลองศึกษาดูด้วยตนเองก่อนนะครับ ผมรับรองว่าไม่ยาก หากติดตรงไหนสอบถามได้ที่กระทู้นี้เลย ว่างๆผมจะมาตอบให้



ดูตัวอย่างจริง ที่ผมเอาไปใช้ครับ
http://youngsoft.nu.ac.th/

ปล.ไม่ได้เข้าโซนไอทีนานเหมือนกัน แหะ

Easy Slider 1.7 - Numeric Navigation jQuery Slider

 

I got a lot of emails and feedback about my easySlider plugin, thank you all for that. However, I have to apologize to all of you who sent emails asking for a little help with implementation or small bug fixes. I simply don't have the time to answer all of your emails. I wish I do.
What I am presenting you today is an easySlider update with 2 new features. When going through your feedback I noticed 2 feature suggestions appearing very often:
  • numeric navigation (as an alternative to next/previous buttons)
  • continuous scroll instead of jumping to the first (or last) slide
So, that's what I implemented in this new version. Now you have the option to choose between classic previous/next navigation or to use a numeric "pagination" style navigation.
Also, your suggestion about continuous scroll made most sense, it is kind of annoying when you have many slides and have to wait for all of them to scroll back to the first one. I had to include it in this version.
I suggest that you read about previous versions in order to understand better how it works:

Options

So, let's go through all of the options. For your convenience I have written the options from previous version of this plugin, so you can have it all in one place. Here they are with their default values:
prevId:   'prevBtn',
prevText:   'Previous',
nextId:   'nextBtn', 
nextText:   'Next',
controlsShow:  true,
controlsBefore: '',
controlsAfter:  '', 
controlsFade:  true,
firstId:   'firstBtn',
firstText:   'First',
firstShow:  false,
lastId:   'lastBtn', 
lastText:   'Last',
lastShow:  false,    
vertical:  false,
speed:   800,
auto:   false,
pause:   2000,
continuous:  false, 
numeric:   false,
numericId:   'controls'

prevId

Id attribute for "previous" button. Default value is "prevBtn".

prevText

Inner text for "previous" button. Default value is "Previous".

nextId

Id attribute for "next" button. Default value is "nextBtn".

nextText

Inner text for "next" button. Default value is "Next".

orientation

Sliding can be horizontal or vertical. Horizontal is default and if you want vertical set this to 'vertical'.

speed

Animation speed in milliseconds, default value is 800.

controlsShow

By default set to true, but if set to false it will not add any controls. It can be used with auto scroll when you want to disable user interaction.

controlsBefore and controlsAfter

In case you want to add some additional markup to gain more control over buttons you can do so by using these parameters. Check out the demo where I use these options.

controlsFade

By default set to true. If set to false it will disable button hiding when slider reaches the end.

firstShow and lastShow

These parameters hide (or show) "go to first" and "go to last" buttons.

auto

This option enables automatic sliding. If you set it to true the sliding will automatically start and continue to perform untill user clicks one of the buttons.

pause

This option is set in milliseconds and it represent the duration of each slide when plugin is set to auto sliding.

continuous

If set to true clicking the next button when the slider reached the end will simply continue showing all of the slides again with continuous motion. Combining this option with auto (both set to true) you'll get endless animation.

numeric (NEW!)

If you set this option to true you will get numeric navigation instead of next/prev buttons. Plugin will create an ordered list just after the slider div. Ordered list will have the exact number of elements as the slider. Clicking on each of the number will make the animation jump to a certain slide.

numericId (NEW!)

This option defines id attribute for the ordered list. You should use this id to select and style the list with CSS.

Demos

I have 3 new demos here:
Here you go. If you have any more suggestions, please send them to me and I will consider of implementing them in the next plugin version!

0 ความคิดเห็น:

แสดงความคิดเห็น