Dynamic JS effect of simulating flash magnifying glass

xiaoxiao2021-04-06  264

Inadvertently seeing a flash, it is a similar magnifying glass that browsing the text one by one, so I want to use JS to express it, it is relatively simple, but the effect is not very good, it seems to be a bug! Continue to work hard. . .

DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transitional // EN"

>

<

HTML

>

<

HEAD

>

<

Meta

HTTP-Equiv

= "Content-Type"

Content

= "Text / html; charset = windows-1250"

>

<

Meta

Name

= "generator"

Content

= "PSPAD Editor, www.pspad.com"

>

<

Title

>

Title

>

<

Style

Type

= "Text / CSS"

>

HTML, BODY

{

Font-size

:

26px

;

Letter-spacing

:

4px

;

Font-family

:

'Arial Black'

}

Style

>

<

Script

Type

= "Text / JavaScript"

>

VAR

Str1

=

"

Tianfeng Fine Chemicals Co.Ltd

"

VAR

i

=

0

;

FUNCTION

Animate () {i

;

VAR

S1

=

Document.getlementByid (

"

S1

"

);

VAR

Len_s

=

Str1.Length;

IF

(i

>

Len_s

-

3

) {i

=

0

} STR2

=

Str1.substring

0

i)

"

"

Str1.substr (i,

1

)

"

"

"

"

Str1.substr (i

1

,

1

)

"

"

"

"

Str1.substr (i

2

,

1

)

"

"

Str1.substring (i

3

, len_s); s1.innerhtml

=

STR2; setTimeout

"

Animate ()

"

,

100

}

Script

>

HEAD

>

<

Body

Online

= "Animate ()"

>

<

Div

id

= "S1">

Div

>

Body

>

HTML

>

转载请注明原文地址:https://www.9cbs.com/read-132313.html

New Post(0)