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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -