jquery - How to change Fancybox script for having a title and description -
i have fancybox v. 2.1.5
my script creates title <a title="">
, description <a alt="">
. "alt" not valid attribute <a>
, call description or 1) <img alt="">
or data-fancybox-desc or <a>
. not know javascript , jquery, can change code ?
the html ok if want use <img alt="">
description :
<div class="view view-add"> <a href="http://www.igorlaszlo.com/images/41.jpg" class="fancybox-thumbs" data-fancybox-group="group1" title="dance in dark"> <img src="http://www.igorlaszlo.com/thumbs/41.jpg" alt="model : thierry mercier" /> <div class="mask"> <h4>dance in dark</h4> <p>model : thierry mercier</p> <div class="info">click zoom</div> </div> </a> </div>
the script should changed:
<script> $(document).ready(function() { $(".fancybox-thumbs").fancybox({ padding: 0, openeffect : 'elastic', openspeed : 150, closeeffect : 'elastic', closespeed : 150, closeclick : true, preveffect : 'elastic', nexteffect : 'elastic', closebtn : true, arrows : true, nextclick : true, beforeshow: function () { this.title = $(this.element).attr('title'); this.title = '<h3>' + this.title + '</h3>' + $(this.element).attr('alt') + '<br />'; aftershow: function() { }, helpers : { title : { type: 'inside' } } }); }); </script>
thanks in advance !
Comments
Post a Comment