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

  • Home
  • SEARCH
  • 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 8712491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:07:15+00:00 2026-06-13T05:07:15+00:00

no matter what value I will it will always refresh as fast as it

  • 0

no matter what value I will it will always refresh as fast as it can.

<!DOCTYPE html>
<html>
    <head>
        <script>
        var ctx, canvas;



        window.requestAnimFrame = (function(callback) {
            return window.requestAnimationFrame || 
            window.webkitRequestAnimationFrame || 
            window.mozRequestAnimationFrame || 
            window.oRequestAnimationFrame || 
            window.msRequestAnimationFrame ||
            function(callback) {
              window.setTimeout(callback, 1000/1 );
            };
      })();

            window.onload = function(){
                canvas = document.getElementById('myCanvas');
                ctx = canvas.getContext('2d');
                //sciana
                drawLine();

            }
            function drawLine(){
            var bok = 400, xw = canvas.width/2, yw = 10, odstep = 10;
            var tX = 10/Math.sqrt(3);
                ctx.save();
                for(var i = xw; i >= xw - bok/2; i-=tX){
                    var r = Math.floor( 255 * Math.random());
                    var g = Math.floor( 255 * Math.random());
                    var b = Math.floor( 255 * Math.random());   
                    ctx.translate(10/Math.sqrt(3), 10);
                    ctx.beginPath();
                    ctx.fillStyle = "rgb("+r+","+g+","+b+")";
                    ctx.arc(xw, 0, 6, 0, 2 * Math.PI, false);
                    ctx.fill(); 
                    ctx.closePath();

                }   
                ctx.restore(); 
                ctx.save();
                    for(var i = xw; i >= xw - bok/2; i-=10/Math.sqrt(3)){
                    var r = Math.floor( 255 * Math.random());
                    var g = Math.floor( 255 * Math.random());
                    var b = Math.floor( 255 * Math.random());   
                    ctx.translate(-10/Math.sqrt(3), 10);
                    ctx.beginPath();
                    ctx.fillStyle = "rgb("+r+","+g+","+b+")";
                    ctx.arc(xw, 0, 6, 0, 2 * Math.PI, false);
                    ctx.fill(); 
                    ctx.closePath();
                }   
                ctx.restore();
                ctx.save();
                xw = xw - bok/2 ;
                yw = bok*Math.sqrt(3)/2;
                for(var i = xw; i <= xw + bok; i+=10){
                    var r = Math.floor( 255 * Math.random());
                    var g = Math.floor( 255 * Math.random());
                    var b = Math.floor( 255 * Math.random());   
                    ctx.translate(10,0);
                    ctx.beginPath();
                    ctx.fillStyle = "rgb("+r+","+g+","+b+")";
                    ctx.arc(xw, yw, 6, 0, 2 * Math.PI, false);
                    ctx.fill(); 
                    ctx.closePath();
                }
                ctx.restore();
                requestAnimFrame(drawLine);             
            }
        </script>
    </head>
    <body>
        <canvas id="myCanvas" width="600" height="600" style="background-color:#D0D0D0">
            Twoja przeglądarka nie obsługuje elementu Canvas.
        </canvas>
    </body>
</html>
  • 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-06-13T05:07:16+00:00Added an answer on June 13, 2026 at 5:07 am

    Because expressions work like this:

    return true || false || function()  {
    // do something
    };
    

    The function will never get executed because JavaScript goes from left to right until it finds something true and then aborts ..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to check if a form input has any value (doesn't matter what
No matter how you scroll, the div should always be at the bottom of
For some reason no matter what, the pageNumber ends up being the last value
I'm attempting to build a window-based application system (a mini GUI, if you will)
I want to change master page some label value from child page.
I have one master report with sub report. in master report display single value
Following matter is JBossAS 7.1 Developer Guider: Change ResourceBundle location In previous versions of
No matter what I try, it never matches the sign. I even tried using
No matter what you read about ASP.NET routing or REST I think the best
No matter how I configure the Credentials property I get a 401 exception when

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.