2012-10-24 35 views
0

得到這個地圖區域如何添加imgpreview插件

<area title="hello" alt="hi there" nohref="<?php bloginfo('template_url'); ?>/images/image1.jpg" shape="rect" coords="216,371,418,490" href="#" /> 

這jQuery代碼

$('#first area').imgPreview({ 
    containerID: 'imgPreviewWithStyles', 
    imgCSS: { 
     // Limit preview size: 
     height: 200 
    }, 
    // When container is shown: 
    onShow: function(link){ 
     $('<span>' + $(link).text() + '</span>').appendTo(this); 
    }, 
    // When container hides: 
    onHide: function(link){ 
     $('span', this).remove(); 
    } 

}); 

如何把在顯示地圖的替代文字的代碼中的alt文本在由imgPreview插件創建的附加跨度中的區域

我認爲這是唯一需要更改的部分

$('<span>' + $(link).text() + '</span>').appendTo(this); 

回答