webnovel

How did JQ create such an effect? What should I add to the auto-read novel function that automatically scrolls 100px every second?

2024-09-17 21:18
2024-09-18 01:15

To achieve an auto-scrolling 100px novel reading function every 1 second in jquery, you can add the following code: ``` //Set novel link <strong></strong></strong> //Set to automatically scroll 100px every 1 second var interval = setInterval(function() { //Get the novel's page's browser element <strong></strong> //Get the novel's page's SSS style <strong></strong></strong><strong></strong> //If the novel's page is set to display: flex, use the flexbox layout. if (novel SSS === display: flex){ //Get the title of the novel's page. var titleHeight = $( #title-container )height(); var titleHeightDelta = 100; //Get the height of the text in the title drop-down box var titleTextHeight = $( #title-container)height(); //calculate the distance of automatic scrolling per second var titleHeightDeltaSizing = Mathfloor(titleHeightDelta / 100); //Create a new flexbox element and set the parent element to display: flex and set flex-direction to row and flex-wrap to wrap to make the title in the drop-down box self-adapting to the height. var titleFlex = $(<div class='title-flex' style='display: flex; flex-direction: row; flex-wrap: wrap; height: + titleHeightDeltaSizing + px;'>) children (h2) children (p)(Please wait for the novel to be automatically read); //Set title flex as parent element var div = $( #title-container )append(titleFlex); //update the title's drop-down box every second titleHTML = titleFlexhtml(); } else { //If the novel's page is set to display: none, use the dom operation to get the novel's page's browser element. if (novel SSS === display: none){ var div = $( <div> ); divcss(display block); //Get the title of the novel's page. var titleHTML = divchildren(h2)html(); //Set the title's drop-down box's element as the parent element var div = $( #title-container )append(titleHTML); } } //Set the tags in the novel page to gray to make the page easier to read divcss(color gray); } 1000); ``` This code would automatically scroll once every second and automatically scroll to the title drop-down box on the novel page. In this example, we used the flexbox layout and set the parent element to display: flex to make the title adapt to the height. We also added a text to the title drop-down box so that we can know the title of the novel when we read it. Before adding the ability to automatically read novels, you also need to add a link to the novel in the page. You can use a text box to do this for example: ``` &lt;input type = text id = novel Link nameplate = novel link/&gt; ``` Next, you can use the `val ()` method of jquery to replace the novel link with the value in the text box so that the server can receive the novel link correctly: ``` //Get the value of the text box varNovelLink =$(#NovelLink) val (); ``` Finally, you can pass the novel link to the server as an argument to retrieve the novel so that you can automatically scroll to the next chapter when reading the novel.

Latest Questions

What's the color style like in Hiruma Yoichi's manga?

The color style of Hiruma Yoichi's manga is distinctive. It uses a combination of warm and cool tones to create a visually appealing effect. The shading and highlighting are done skillfully to add depth and dimension to the illustrations.

2 answers
2025-12-06 05:23

Will the school start soon in Comic Sans style?

Yes, it seems the school is going to start soon and it's presented in Comic Sans.

2 answers
2025-12-06 05:23

How is the 'That Time I Got Reincarnated as a Slime' web comic?

It's really great! The story is engaging and the art is amazing.

3 answers
2025-12-06 05:23

What are the characteristics of Jerry Seinfeld's comics?

Jerry Seinfeld's comics are characterized by sharp timing, clever wordplay, and a unique perspective on common situations. His style is relatable yet distinct, making audiences laugh at things they might not have noticed before.

1 answer
2025-12-06 05:23

Do you like the manga 'Your Mom' and why?

I don't like it. The story just doesn't appeal to me.

3 answers
2025-12-06 05:22

What is the extent of coverage of One Piece manga?

It's extensive. One Piece manga has a vast and detailed story with many arcs and characters.

1 answer
2025-12-06 05:22

Which first edition comics are worth collecting?

The worth of first edition comics depends on various factors. Comics featuring rare characters, those from well-known authors or illustrators, or comics that mark significant events in the comic book universe are often worth collecting. For example, the first edition of Spider-Man when he was introduced could be very valuable.

1 answer
2025-12-06 05:21

What are some notable features of bird superheroes in Comic Vine?

Bird superheroes in Comic Vine are known for their distinct personalities. Some are brave and fearless, while others are more strategic and thoughtful. Their powers can range from super strength while in flight to the ability to create sonic blasts with their wings. Plus, their relationships with other heroes and villains add depth to their characters.

1 answer
2025-12-06 05:21

How does the Thanos snap in the Infinity War comic compare to its portrayal in the movie?

The comic snap is quite similar to the movie. Both have a huge impact on the universe and its characters.

2 answers
2025-12-06 05:20

What does the phrase 'love is comic strrip tshirt' imply?

The phrase 'love is comic strrip tshirt' might mean that love is as eye-catching and unique as the designs on comic strip tshirts. It could be a symbolic way of expressing the idea that love is something that stands out and makes a statement, just like those tshirt designs.

1 answer
2025-12-06 05:20
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z