DHTML implements controllable scrolling regions within pages

Source: Internet
Author: User
dhtml| Control | Page First, we add ". Opacity {Filter:alpha (opacity=100)" to the stylesheet, look below!
<style type= "Text/css" >
<!--
. Opacity {Filter:alpha (opacity=100)}
-->
</style>

Then add in the HTML code:

<script>
function Movstar (a,time) {
Movx=setinterval ("mov (" +a+ ")", Time)
}
function Movover () {
Clearinterval (MOVX)
}
Function mov (a) {
Scrollx=new_date.document.body.scrollleft
Scrolly=new_date.document.body.scrolltop
Scrolly=scrolly+a
New_date.window.scroll (scrollx,scrolly)
}
function O_down (theobject) {
Object=theobject
while (object.filters.alpha.opacity>60) {
OBJECT.FILTERS.ALPHA.OPACITY+=-10}
}
function O_up (theobject) {
Object=theobject
while (object.filters.alpha.opacity<100) {
OBJECT.FILTERS.ALPHA.OPACITY+=10}
}
function Wback () {
if (new_date.history.length==0) {window.history.back ()}
Else{new_date.history.back ()}
}
</script>


Then add the class= "opacity" onmousedown=movover () to the code of the Up Arrow picture () Movstar ( -3,2) onmouseout=movover () o_up (this) onmouseover= Movstar ( -1,20); O_down (this) onmouseup=movover (); Movstar ( -1,20) alt= "Live and hold, you can quickly scroll up".

As shown below:



This is the code that controls text to scroll up, and when the mouse moves to the up.gif picture, the text scrolls up, and pressing the arrow text speeds up the scroll up.

The down arrow picture is produced in the same way as above. In the code, add "class=" opacity "onmousedown=movover (); Movstar (3,2) onmouseout=movover (); o_up (this) Onmouseover=movstar ( 1,20); O_down (this) onmouseup=movover (); Movstar (1,20) alt= "Live and hold, you can quickly scroll down" ".

As shown below:



Then add the following code to the area where you want to display the text:

<iframe border=0 frameborder=0 framespacing=0 height=120 marginheight=0 marginwidth=0 name=new_date noResize Scrolling=no src= "iframe.htm" width=200 vspale= "0" ></iframe>

Connect to a page called iframe.htm. where height=120 width=200 controls the size of the display area of the Iframe.htm page on the current page. Edit the iframe.htm file and put it in the content you want to update.



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.