Home > Web Front-end > JS Tutorial > Use javascript to implement code for browsing large pictures in small boxes_javascript skills

Use javascript to implement code for browsing large pictures in small boxes_javascript skills

WBOY
Release: 2016-05-16 19:10:09
Original
1093 people have browsed it

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



Untitled Document
#pic {
height: 300px; width: 420px;
border: 3px solid #ccc; background-image: url(http://www.happyshow. org/sample/20060619/3.jpg);
background-repeat: no-repeat;
background-position: 0px 0px;
background-color: #333;
cursor: crosshair;
} -->









Playing google today earth 4.0b, I found that the pictures from Print Screen were very large. If I put them directly on the web page, the size would be too big and inappropriate, and I didn’t want to compress the size of the pictures, so I thought of this method. Unexpectedly, it was easier to implement than expected. It's easier. Haha, damn, this code is also compatible with firefox. nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I was playing google earth 4.0b today and found that the pictures from Print Screen were very large. It would not be suitable to put them on the web page, and I didn’t want to compress the size of the pictures, so I thought of it. I found this method, but I didn’t expect it to be easier to implement than expected. Haha, damn, this code is also compatible with firefox.
-------------------------------------------------- ------------------------------------------
2006.6.20 Modification: ·Added scrolling range, no background will appear
·Using onmousemove event, the picture moves in real time as the mouse moves




Untitled Document
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template