Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3632874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:34:51+00:00 2026-05-19T00:34:51+00:00

<script> function mySlide() { var myFx = new Fx.Slide(‘my-slide’, { duration: 1000, transition: Fx.Transitions.Pow.easeOut

  • 0
<script>
     function mySlide()
     {
        var myFx = new Fx.Slide('my-slide', {
            duration: 1000,
            transition: Fx.Transitions.Pow.easeOut
        });

        //Toggles between slideIn and slideOut twice:
        myFx.toggle().chain(myFx.toggle);

     }

     var interval = null;

     function clearTime()
     {
        $clear(interval);
     }

     function play()
     {
        interval = mySlide.periodical(1000);
     }
</script>
<div onclick="clearTime();"> stop </div>
<div onclick="play();"> play </div>
<img id="my-slide" src="http://lh5.ggpht.com/_8Nsej4QeRGg/TE5m5zRf4bI/AAAAAAAAAgo/pQGKPX8zn9c/gadget-01.jpg"/>

When I tried the above code with safari, the task manager in windows shows CPU utilisation of 30%-50%

When I put the above code in a full page with other html code, the utilisation is 60%-70%

So what is different? Why is the js faster on a clear page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:34:52+00:00Added an answer on May 19, 2026 at 12:34 am

    Because your script affects the page. I presume it adds something to the page, and then animates it. This requires the browser to:

    • search the elements on the page for the position to insert your new element(s) (called DOM traversal – not so much of a problem since you’re using an ID, and not complex selectors)
    • calculate and re-render the page as elements get pushed around (called reflow – this is the most expensive)

    Therefore in general, the more elements on your page, and the more CSS rules, the longer the DOM traversal and the reflow takes.

    More on reflow:

    • http://code.google.com/speed/articles/reflow.html
    • http://www.mozilla.org/newlayout/doc/reflow.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have put together the following mootools script window.addEvent('domready', function() { var shouts =
My script: (function($){ $.fn.megaswitcher = function(settings) { return this.each(function() { var $i = $(this),
For example: script.js: function functionFromScriptJS() { alert('inside functionFromScriptJS'); } iframe.html: <html> <head> <script language=Javascript
I have a calc function in java script that takes three integer parameters, following
I have a bash script file which starts with a function definition, like this:
Can you use the bash getopts function twice in the same script? I have
What I want to do is trigger a function from an extension/GM Script once
This question is simple. What function would I use in a PHP script to
Is there any way to have PHP automatically call a function, before a script
I'm using the following JavaScript code: <script language=JavaScript1.2 type=text/javascript> function CreateBookmarkLink(title, url) { if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.