webguync Posted September 7, 2014 Share Posted September 7, 2014 Hi, I am using fancybox on my site and the function I am using to display the title and data-caption is this. $(document).ready(function() { $('.fancybox').fancybox({ beforeShow : function(){ this.title = this.title +"<br>" + $(this.element).data("caption"); } }); }); // ready I would like to change this so that I can add a hypertext link. Here is what a sample of the HTML looks like: <img src="img/portfolio/GSI_web.png" height="194" width="400" alt="Globalsoftwareinc.com" /> <h4>www.globalsoftwareinc.com</h4> <div class="portfolio-desc align-center"> <div class="folio-info"> <h5><a title="globalsoftwareinc.com" href="#" title="www.globalsoftwareinc.com">Globalsoftwareinc.com</a></h5> <a title="Global Software Inc. website" href="img/portfolio/GSI_web_large.png" class="fancybox" data-caption="I was the interactive web designer at Global Software, Inc. and assisted in the re-design and development of Global Software, Inc. in Drupal<br>www.globalsoftwareinc.com"><i class="fa fa-plus fa-2x"></i></a> </div> </div> </div> </article> so for example I would want to make www.globalsoftwareinc a hyperlink and that isn't do-able currently. It breaks the code. thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/290909-help-with-fancybox-function-to-allow-adding-a-hypertext-link/ Share on other sites More sharing options...
Solution webguync Posted September 8, 2014 Author Solution Share Posted September 8, 2014 never mind. It was just a matter of changing the double quote to single around the links. Quote Link to comment https://forums.phpfreaks.com/topic/290909-help-with-fancybox-function-to-allow-adding-a-hypertext-link/#findComment-1490324 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.