在国外的网站看到一个很不错的图片自动展示效果,于是就自己做了起来,在查看代码时发现是一个JavaScript爱好者自己写了一个库文件来调用,确实看的不太懂,但效果是做出来了,页面的调用代码只需引用固定的JS文件和CSS文件,然后用户可以自己定义展示的图片。
页面调用代码如下:
--
表头引用的CSS文件和JS文件
< head runat = " server " >
< title > 无标题页 </ title >
< link rel = " stylesheet " href = " backbox.css " type = " text/css " />
< script type = " text/javascript " src = " js/prototype.compressed.js " ></ script >
< script type = " text/javascript " src = " js/scriptaculous.js?load=effects " ></ script >
< script type = " text/javascript " src = " js/lightbox.js " ></ script >
< script type = " text/javascript " src = " js/dhtmlHistory.js " ></ script >
< script type = " text/javascript " src = " js/customsignsheader.js " ></ script >
</ head >
-- 页面调用代码(其实中主要展示是一个Div层的效果)
< div >
< div onclick = " dhtmlHistory.add('location1',{message: 'backbox'});countdown() " >
< a href = " images/babyhand.jpg " rel = " lightbox[slide] " caption = " A Bunch of Grapes " >
< img src = " images/sunset.jpg " alt = " lime " width = " 400 " height = " 300 " border = " 0 " /></ a >
</ div >
< a href = " images/desert.jpg " rel = " lightbox[slide] " caption = " Sunflower " ></ a >
< a href = " images/beech.jpg " rel = " lightbox[slide] " caption = " Dolphin " ></ a >
< a href = " images/lime.jpg " rel = " lightbox[slide] " caption = " Waterfall " ></ a >
</ div >
-- 最后引用的库文件
< script type = " text/javascript " src = " js/customsignsfooter.js " ></ script >
< head runat = " server " >
< title > 无标题页 </ title >
< link rel = " stylesheet " href = " backbox.css " type = " text/css " />
< script type = " text/javascript " src = " js/prototype.compressed.js " ></ script >
< script type = " text/javascript " src = " js/scriptaculous.js?load=effects " ></ script >
< script type = " text/javascript " src = " js/lightbox.js " ></ script >
< script type = " text/javascript " src = " js/dhtmlHistory.js " ></ script >
< script type = " text/javascript " src = " js/customsignsheader.js " ></ script >
</ head >
-- 页面调用代码(其实中主要展示是一个Div层的效果)
< div >
< div onclick = " dhtmlHistory.add('location1',{message: 'backbox'});countdown() " >
< a href = " images/babyhand.jpg " rel = " lightbox[slide] " caption = " A Bunch of Grapes " >
< img src = " images/sunset.jpg " alt = " lime " width = " 400 " height = " 300 " border = " 0 " /></ a >
</ div >
< a href = " images/desert.jpg " rel = " lightbox[slide] " caption = " Sunflower " ></ a >
< a href = " images/beech.jpg " rel = " lightbox[slide] " caption = " Dolphin " ></ a >
< a href = " images/lime.jpg " rel = " lightbox[slide] " caption = " Waterfall " ></ a >
</ div >
-- 最后引用的库文件
< script type = " text/javascript " src = " js/customsignsfooter.js " ></ script >
演示完整的代码DEMO下载地址: http://good.gd/159245.htm