在 Highslide JS 中的标题中使用引号

Using Quotations Marks in a title in Highslide JS

本文关键字:Highslide JS 标题      更新时间:2023-09-26

我正在使用Highslide作为我网站的图片查看器,并希望能够在标题中的某些文本中使用引号。当只是将相关文本放入引号中时,所有超出第一个引号的文本都丢失了。希望对此事有所帮助 - 以下示例:

<a class='highslide' href='../g94/18.jpg'
    title="If I put text here and want "This piece in quotation marks" to make it stand out"
    onclick="return hs.expand(this, miniGalleryOptions1)">
<img src='../g94/s18.jpg' alt=''/></a>

结果是 - 如果我把文本放在这里并想要

或;

<a class='highslide' href='../g94/18.jpg'
    title="If I put text here and want '"This piece in quotation marks'" to make it stand out"
    onclick="return hs.expand(this, miniGalleryOptions1)">
<img src='../g94/s18.jpg' alt=''/></a>

结果是 - 如果我把文本放在这里并想要 ''

谢谢约翰

最简单的解决方法是对 title 属性使用单引号:

title='If I put text here and want "This piece in quotation marks" to make it stand out'