jquery - How do I change Colorbox's description from the title attribute to alt? -


basically, i'm using title attribute tooltip, , change description of image in colorbox title alt instead. i've found solutions, they've wordpress plugin, , i'm trying on website.

script:

$(document).ready(function(){ //examples of how assign colorbox event elements  $(".group1").colorbox({rel:"group1", transition:"elastic", maxheight:"90%", scalephotos:true});  });  $(function() { $(".thumb").tooltip({ position: { my: "center bottom-20", at: "center top", using: function( position, feedback ) { $( ).css( position ); $( "<div>" ) .addclass( "arrow" ) .addclass( feedback.vertical ) .addclass( feedback.horizontal ) .appendto( ); } } }); }); 

html:

<div class="mosaic-block bar"> <a class="group1" href="images/amaasb.jpg" title="as art science."> <img src="images/amaass.png" title="title: art science. texttexet" border="0"  style="width: 100%;" class="thumb"/> </a> </div> 

thanks!

pulled directly colorbox usage guidelines:

// colorbox can accept function in place of static value: $("a.gallery").colorbox({title: function(){   return $(this).attr('alt'); }}); 

oh, looks need pull alt image inside link. need query children of anchor tag. maybe this:

$(this).children('img').attr('alt'); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -