In Prettyphoto.js or Fancybox… How to add a link within the caption

六月ゝ 毕业季﹏ 提交于 2019-12-05 10:31:22

If it's like most 'lightbox' plugins, I believe you need to do this use character entities for example:

<a href="test.html">hello</a>

would become

&lt;a href=&quot;text.html&quot;&gt;hello&lt;/a&gt;

Put this in your title tag and it will link.

Get a full list of HTML character entities at http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Thanks so much for this post! It helped me greatly, but then the tooltip showing up blew it all out of the water for me. THEN! I found an easy fix to that part also. Add a title attribute that contains a space (must have a space) to the img inside the anchor tag:

    <a title="&lt;p&gt;&lt;a href=&quot;http://www.mysite.com&quot; title=&quot;&quot;   target=&quot;_blank&quot;&gt;http://www.mysite.com&lt;/a&gt;&lt;/p&gt; " rel="prettyPhoto" href="http://www.mysite.com/wm/wp-content/themes/site/images/portfolio/image.jpg" style=""><img alt="Interactive" **title=" "** src="http://www.mysite.com/wm/wp-content/themes/site/images/portfolio/image.jpg"></a>

Wahoo! No Tooltip and the caption works with a link added.

This topic of PrettyPhoto and the inability to add a photo download link has been a discussion for a couple of years now. I'm amazed that the original authors have not addressed this ... as far as I know.

There are now several versions of PrettyPhoto, including some mash-ups that are used as plugins for Joomla, WordPress, etc.

So I took the Joomla plugin and modified it. It can run stand-alone, without Joomla (as I don't use Joomla). You can see my modification here: http://www.catpin.com/prettyphoto

I also include two zipped files: 1) the actual jquery.prettyPhoto.js file 2) the PHP script that does the download (opens the browser download dialog box).

I hope this helps out ... or at least gives you an idea that it can be done.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!