javascript - How to display image with fancybox href attribute -


i trying show image fancybox 1.3 . have managed base64 coding, worked charm. now, want retrieve image through servlet. if put url image src attribute, shows image, if put url href attribute, when click on picture shows this:

http://i.imgur.com/oqxruxc.png

i set response content type correctly. can problem?

here's example display base64 image fancy box

you don't need <a> tag

<div class="content"> <img  src="data:image/gif;base64,/9j/4aaqskzjrgab...." alt="social media" > <img  src="data:image/gif;base64,/9j/4aaqskzjrgab...." alt="james bond;" >  </div> 

jquery

  $('.content').on('click', 'img', function (e) {      var target= $(this).attr("src");     var imgtitle= $(this).attr("alt");      $.fancybox({                               'overlayshow': true,                 'href': target,                 'titleposition': 'inside',                                 'title': imgtitle,                            });         }); 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -