jQuery imgDesc

jQuery imgDesc
This plugin is written with the develpment of PageTalks, accidently. As PageTalks is based on jQuery Libary, jQuery code is required.
jQuery Libary, just downlaod from
imgDesc script file(oops……)
a little knowledge on xhtml and js
This plugin will automatically take title attribute in IMG tag as the description of the image. If IMG is not wrapped by a Anchor tag, the plugin will wrap it with one. This plugin currently support two parameters, all of which are optional.
autohide if the plugin should automatically hide the description and show it when mouseover. Default "yes"
text Customize the value of description. Default value is the title attribut of IMG tag
Load jQuery Libary
You can directly add the following code in <head> tag:
  1. <script type="text/javascript" src="jquery..js"></script> 
Load imgDesc Plugin
  1. <script type="text/javascript" src="jquery.imgdesc.js"></script> 
Assing the target object

follow the jQuery code style:$("img").imgDesc();You can, of course , apply some change, customizing the way it show up and the value of description:$("img").imgDesc({autohide: "yes", text : "This is a sample text!"}); 

转载请注明:代码家园 » jQuery imgDesc