我有一个 JS _buildPlaylist 文件,我看到这个例子:
//create thumb thumb=$(new Image()).addClass('thumb_img').appendTo(div).attr('alt', _item.title?_item.title:'').css({ cursor:'pointer', opacity:0 }).load(function() { $(this).stop().animate({ 'opacity':1}, {duration: 500, easing: 'easeOutSine'});//fade in thumb }).error(function(e) { }).attr('src', _item.thumbnail);
The line for crear image thumb with "alt title name"
This is the result:
<img class="thumb_img" alt="Sample title builded here" style="cursor: pointer; opacity: 1;" src="http://mywebsite.com/image.jpg">
<小时/>
如您所见,这将创建一个带有替代文本属性的图像
现在,我想改建一个
- 此处构建的示例标题(这是 ALT 标题名称)
那么,如何将图像缩略图更改为文本,或仅显示替代标题?
最佳答案
如果您不想显示图像,则无需使用in
标签。
只需将其作为标签
或链接
即可。这样就可以了。
关于javascript - 将图像属性更改为<li>示例标题</>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13880196/