jQuery imgDesc

授权协议 未知
开发语言
所属分类 jQuery 插件、 其他jQuery插件
软件类型 开源软件
地区 不详
投 递 者 贡威
操作系统 未知
开源组织
适用人群 未知
 软件概览

Description

This plugin is written with the develpment of PageTalks, accidently. As PageTalks is based on jQuery Libary, jQuery code is required.

Requirements

  • jQuery Libary, just downlaod fromjQuery Offical Site
  • imgDesc script file(oops……)
  • a little knowledge on xhtml and js

Features

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

Usage

Load jQuery Libary
You can directly add the following code in <head> tag:<script type="text/javascript" src="jquery..js"></script>
Load imgDesc Plugin
<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通过name属性取值的方法 //$("input[name='imgtitle']").val();//这个只能取到第一个的值 //通过each函数取得所有input的值 var titles = ""; $("input[name='imgtitle']").each(function(){ titles += $(this).val()+","; }); //取textarea的值

相关阅读

相关文章

相关问答

相关文档