The view Layer Code is as follows:
<A rel = "group" href = "/Photo/index/<%: item. photoid %> "Title =" <%: item. describe %> "> "alt =" <%: item. describe %> "/> </a>
URL:/Photo/index/1 will return the image data with ID 1 in the database.
On the front-end client page, fancybox is used to display images, but Garbled text is used to display image data.
Go to the official website to check relevant information and find that you can use the type option to solve this problem. Set type to image.
The sample code is as follows:
<SCRIPT type = "text/JavaScript">
$ (Document). Ready (function (){
$ ("A [rel = Group]"). fancybox ({
'Transitionin': 'none ',
'Transitionout': 'none ',
'Titleposition': 'over ',
'Type': 'image ',
'Titleformat': function (title, currentarray, currentindex, currentopts ){
Return '<span id = "fancybox-title-over"> image' + (currentindex + 1) +'/'+ currentarray. Length + (title. length? '& Nbsp;' + title: '') + '</span> ';
}
});
});
</SCRIPT>
Original article. For more information, see the source. Yan shidan @ Qufu Normal University volcanosoft