Garbled characters appear in fancybox images under ASP. NET MVC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.