If you're new here, you may want to subscribe to our RSS feed as well as to our NewsLetter (on Top Right hand menu) to get highly informative articles weekly...and NO, we never spam!如果你是新這裡,你可以訂閱我們的rss以及我們簡訊 (頂右手菜單) ,以獲得翔實周刊文章… …不,我們從來垃圾!
What this article will actually teach you Is how to develop a JavaScript gallery that is backed up by a PHP script – a very often used combination for when trying to build up a nice and useful gallery.這是什麼文章其實教導你的是如何發展一個javascript畫廊是後盾php腳本-一個很常用的組合,當試圖建立一個好的和有用的畫廊。
What is a thumbnail gallery?什麼是縮略圖畫廊?
Of course, before starting anything we need to know what exactly a thumbnail gallery is and what it is useful for (or in more popular terms – what does it do?).當然,出發前什麼,我們必須知道什麼縮略圖畫廊是什麼和它是有用的(或較受歡迎的條款-做些什麼呢? ) 。 Remember when web browsers have just started supporting images and web connections speeds were so slow that we were measuring them in single kilobits?記得當瀏覽剛開始支持圖像和網絡連接的速度這麼慢,我們測量了他們在單千? Of course you do.當然,你做的。 Now, the job of a thumbnail gallery was, and still is to display several smaller previews of the original images.現在,就業的縮略圖畫廊是,現在仍然是展示一些較小的預演原始影像。
Smaller not only in dimensions but also in file size – this is even more important.小不僅在尺寸,而且在檔案大小-這是更重要。 This would mean that anyone who would visit the gallery would not be required to download all images, but only the one that he needs or wants.這將意味著任何人將參觀畫廊,將無需下載所有圖像,但只有一個,他需要或想要。 This saves you server traffic, and him, time.這可以節省你的服務器交通,並他的時候。 The problem occurs when most of these thumbnail galleries fail to do exactly this – avoid making the user download all the files.問題發生時,大部分這些縮略圖畫廊未能做到這一點-避免使用戶下載所有檔案。 Even more, if you resize your images using CSS and JavaScript, or you simply use HTML attributes for resizing you will find yourself with a bunch of low-quality thumbnails.更有什者,如果你resize你的圖片用css和javascript的,或者你簡單地使用html屬性為縮放,你會發現自己與一群低品質圖片。
In order to avoid this, and offer thumbnail galleries as they should like, you will need to create smaller pictures of the large images that you intend to put in your gallery.為了避免這種情況,並提供縮略圖畫廊,因為他們想,你將需要創造較小的照片大畫面,你打算把你的畫廊。 There are several ways to do this – through a batch process before you upload the gallery or simply using a script on the server.有幾種方法來做到這一點-通過批處理過程,然後你上傳畫廊或乾脆用一個腳本對服務器。
Using Javascript to fake dynamic galleries用javascript假畫廊動態
Nowadays static galleries are rather boring, so go for dynamic galleries.如今靜態的畫廊都是比較沉悶,所以去動畫廊。 In order to create a dynamic gallery from a static thumbnail gallery you can use JavaScript.為了創造一個充滿活力畫廊從靜態縮略圖畫廊,你可以使用javascript的。 You will turn it into a dynamic gallery by simply applying to all thumbnails a series of event handlers.你會變成一個充滿活力畫廊只是適用於所有縮略圖的一系列事件處理器。 Still, you should keep the gallery even for users that do not use JavaScript.還有,你應該把畫廊即使使用者不使用javascript的。 Use the script below:使用腳本如下:
<ul id =”thumbnails” > <li> <a href =”gallery/temp/img1.jpg” > <img src =”gallery/temp/img1_th.jpg” alt =”img1_th.jpg”/ > </a> </li> <li> <a href =”gallery/temp/img2.jpg” > <img src =”gallery/temp/img2_th.jpg” alt =”img2_th.jpg”/ > </a> </li> [… and so on with the thumbnails …] </ul> <ul 身份證 ="thumbnails" > <li> <a href ="gallery/temp/img1.jpg" > <集團 康 = " gallery/temp/img1_th.jpg " 低價競標 = " img1_th.jpg " / > < / > < / 李> <li> <a href ="gallery/temp/img2.jpg" > < 集團 康 = " gallery/temp/img2_th.jpg " 低價競標 = " img2_th.jpg " / > < / > < /李 > [ … …等與圖片… … ] < /超微結構 > Now you can start creating a dynamic gallery using JavaScript!現在你可以開始創建一個動態廊用javascript ! Good luck!好運!
Related Articles - Yahoo Library with PHP | Create Own Del.icio.us Clone | Build Site like Reddit or Digg 相關文章-雅虎圖書館與p hp|創造自己的d el.icio.us的克隆|網站建設一樣雷迪特或誼
Javascript library javascript的 圖書館Links you may find interesting -聯繫,你可以找到有趣-
- Learn JavaScript - Make user experience better with Client Side Scripting javascript的學習-讓用戶體驗更好地與客戶端腳本
- How to use Wordpress as CMS ? 如何使用wordpress的作為厘米?
- How to Create Image Thumbnails with PHP using GD Library 如何創建圖像縮略圖用php利用gd庫
- What is Firefox 什麼是火狐
- Create Drop Down Menu using YUI (Yahoo User Interface) Library 創建下拉菜單用銳(雅虎用戶界面)圖書館




























