File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ function mfbfw_defaults() {
117117 'callbackOnComplete ' => 'function() { alert("Complete!"); } ' ,
118118 'callbackOnCleanup ' => 'function() { alert("CleanUp!"); } ' ,
119119 'callbackOnClose ' => 'function() { alert("Close!"); } ' ,
120+ 'copyTitleFunction ' => 'var arr = jQuery("a.fancybox");
121+ jQuery.each(arr, function() {
122+ var title = jQuery(this).children("img").attr("title");
123+ jQuery(this).attr("title",title);
124+ }) ' ,
120125
121126 // Troubleshooting
122127 'nojQuery ' => '' ,
@@ -231,12 +236,9 @@ function mfbfw_init() {
231236<script type="text/javascript">
232237 jQuery(function(){
233238
234- jQuery.fn.getTitle = function() { // Copy the title of every IMG tag and add it to its parent A so that fancybox can show titles
235- var arr = jQuery("a.fancybox");
236- jQuery.each(arr, function() {
237- var title = jQuery(this).children("img").attr("title");
238- jQuery(this).attr("title",title);
239- })
239+ jQuery.fn.getTitle = function() { // Copy the title of every IMG tag and add it to its parent A so that fancybox can show titles ' ;
240+ <?php echo $ settings ['copyTitleFunction ' ]; ?>
241+ echo '
240242 }
241243
242244 // Supported file extensions
Original file line number Diff line number Diff line change 8585 <?php _e ('Callback on <strong>Closed</strong> event: Will be called once FancyBox is closed ' , 'mfbfw ' ); ?>
8686 <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnClose]" wrap="physical" id="callbackOnClosed"><?php echo ($ mfbfw ['callbackOnClose ' ]); ?> </textarea>
8787 </label><br /><br/>
88+
89+ <label for="copyTitleFunction">
90+ <?php _e ('Function to copy title from different source then Fancybox default anchor title ' , 'mfbfw ' ); ?>
91+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[copyTitleFunction]" wrap="physical" id="copyTitleFunction"><?php echo ($ settings ['copyTitleFunction ' ]); ?> </textarea>
92+ </label><br /><br/>
8893
8994 <small><strong><em><?php _e ('Example: ' , 'mfbfw ' ); ?> </em></strong></small><br />
9095 <small><em><code>function() { alert('Hello world!'); }</code></em></small><br />
You can’t perform that action at this time.
0 commit comments