jQuery Capty 图片标题插件

jQuery Capty是可以为图片添加漂亮的字幕的插件

文件包含:

<link type="text/css" rel="stylesheet" href="/capty/css/jquery.capty.css"/>
<script type="text/javascript" src="/capty/js/jquery.js"></script>
<script type="text/javascript" src="/capty/js/jquery.capty.min.js"></script>
调用方法:

实例1:图片的alt标签默认被应用于标题内容

<img id="default" src="image.jpg" alt="Super Mario Bros.®" width="342" height="262"/> 

$('#default').capty();

实例2:自定义动画和速度

<img id="animation" src="image.jpg" alt="Super Mario Bros.®" width="342" height="262"/>

$('#animation').capty({
  animation: 'fade',
  speed:     400
});

实例3:固定标题

<img id="fixed" src="image.jpg" alt="Super Mario Bros.®" width="342" height="262"/>
$('#fixed').capty({
  animation: 'fixed'
});

实例4:自定义标题与外部扩展内容

<img id="content" src="image.jpg" name="#content-target" width="342" height="262"/>

<div id="content-target">
  <span style="color: #F00;">Mario</span> - Super Mario Bros.®<br/>
  <a href="javascript:void(0);">http://www.mariobros.com</a>
</div>
$('#content').capty({
  height:   46,
  opacity:  .6
});

实例5:用后缀,前缀和一个自定义的风格应用于一组元素

<img src="image-1.jpg" class="fix" width="240" height="161"/>
<img src="image-2.jpg" class="fix" width="240" height="161"/>
<img src="image-3.jpg" class="fix" width="240" height="161"/>
$('.fix').capty({
  cWrapper:  'capty-tile',
  prefix:    '<span style="color: #35BB87">Luigui</span>',
  sufix:     'Super Mario Bros.®'
});

默认设置选项

animation:    'slide'
The captions animation type: 'slide', 'fade' or 'fixed'.
cCaption:     'capty-caption'
The class name of the wrapper caption.
cImage:       'capty-image'
The class name of the wrapper image.
cWrapper:     'capty-wrapper'
The class name of the wrapper image and caption.
height:       30
The height of the caption.
opacity:      .7
The opacity of the caption.
prefix:       ''
The text/html that will be applied at the beginning of the legend.
speed:        200
The speed in which caption will appear and disappear.
sufix:        ''
The text/html that will be applied at the end of the caption.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值