Modify Internet news. net

Source: Internet
Author: User
1. Cut the size of the image called on the homepage.

If you directly set

<SCRIPT type = "text/JavaScript"> var thumbwidth = 160; var thumbheight = 0; var thumbhwidth = 160; var thumbhheight = 0; </SCRIPT>

If the value of thumbhheight is not suitable for a specific image, the displayed image is ugly. Add/INC/thumbnail. js

Function writethumb (IMG, URL, ALT, blank, highlight)

{

If (blank = NULL)

Blank = false;

If (Highlight = NULL)

Highlight = false;

With (document ){

Write ("<Table class = 'thumbnail '> ");

Write ("<tr> <TD style = 'overflow: hidden; '> ");

// The <div> below defines the size of the image frame when the homepage calls the image file. overflow: hidden indicates that the part beyond the image frame is cut.

Write ("<Div style = 'overflow: hidden; width: 160px; Height: 120px; '> ");

Write ("<a href = '");

Write (URL );

If (blank)

Write ("'target = '_ blank'> ");

Else

Write ("'> ");

Write ("
Write (IMG );

Write ("'alt = '");

Write (ALT );

Write ("'");

If (highlight ){

If (thumbhwidth> 0 ){

Write ("width = '");

Write (thumbhwidth );

Write ("'");

}

If (thumbhheight> 0 ){

Write ("Height = '");

Write (thumbhheight );

Write ("'");

}

} Else {

If (thumbwidth> 0 ){

Write ("width = '");

Write (thumbwidth );

Write ("'");

}

If (thumbheight> 0 ){

Write ("Height = '");

Write (thumbheight );

Write ("'");

}

}

// Add </div>

Write ("> </a> </div> </TD> </tr> </table> ");

}

}

In this way, the preset size of the image is reduced, and the effect is much better.

2. Friendship

You cannot delete all links before adding them. This may cause an error. It may be a bug.

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.