Skip to main content

Create a Html page Template which background color changes with time

Create a HTML page Template  which background color changes with time.


Click to Down lode changing color HTML template with source code







to create this page you need to 

1.download   jquery-2.0.0.min.js   jQuery 

2. Embed  above jquery  in your HTML page 

     <script src="jquery-2.0.0.min.js">

3. using script tag embed following java script in your page 

 .<script language="javascript">     

        $(document).ready(function(){

        $("#pramod").css('width','980px');
        $("#pramod").css('height','600px');

            var x=0;
            var y=0;   
            var z=0;
        setInterval(function(){
            $("#pramod").css('background-color','rgb(' +x+ ',' +y+','+z+')');
            setInterval(function() {
                             x+=10;
                y+=1;
                                z+=10;
                          },1000);
             },1000);
           
 
        });

        </script>


Explanation : 

in this tutorial we have used rgb( , ,) function to set background color to the HTML tag

 

What is rgb() function ?

as we know basic colors are three red , Green and Blue

all other color are developed by this three color. in rgb() is a function and it has three parameters we have to provide in numbers the minimum value is 0 and highest is 255

so if we set bgcolor= rgb(0,0,0);  then it will be black it may change on  monitor resolution .

in above task  x ,y ,z are three variable represent red, green and blue value in rgb as rgb(x,y,z);

using loop the value is increased using jquery time interval is set .

The you can download  Complete code by clicking following link









Click to Down lode changing color HTML template with source code

 


<html>
    <head>
        <title>sample</title>
        <script src="jquery-2.0.0.min.js"></script>
<script language="javascript">
     
        $(document).ready(function(){

        $("#pramod").css('width','980px');
        $("#pramod").css('height','600px');

            var x=0;
            var y=0;   
            var z=0;
       
            

                   setInterval(function(){
            $("#pramod").css('background-color','rgb(' +x+ ',' +y+','+z+')');
            setInterval(function() {
                             x+=10;
                y+=1;
                                z+=10;
                          },1000);
             },1000);
           
 
        });

        </script>
    
    </head>
       <body bgcolor="orange">

       <div id="pramod">
    </div>

    </body>
    </html>





 Solved by :Pramod Slave 
 MCA IMSCDR Ahmednagar
  HTML5 CSS3 Sesson



Popular posts from this blog

Design Marathi website Using HTML CSS

          Design Marathi website Using HTML CSS,मराठी वेबसाईट designing HTML ,step by step Marathi website, how to display Marathi content in your website, Design Marathi website step by step , Marathi website using HTML and CSS, How To Design website using different Languages  Design Marathi website Using HTML CSS, Design Marathi website Using PHP, Design Marathi website Using JSP, Design Marathi website Using ASP, Design Marathi website Using C# Dot Net, Design Marathi website Using Vb Dot Net, मराठी वेबसाईट मराठी वेबसाईट बनवन अगदी सोप आहे मी या ब्लॉग मध्ये दिलेल्या स्टेप्स वापरून तुम्ही काही क्षणात मराठी वेब पेज तयार करू शकता  Design Marathi website Using HTML CSS,मराठी वेबसाईट designing HTML ,step by step Marathi website, how to display Marathi content in your website, Design Marathi website step by step , Marathi website using HTML and CSS, How To Design website using different Languages    Design Marathi website U

Create HTML CSS javascript News Box , HTML CSS News Slider Download

Create HTML CSS javascript News Box , HTML CSS News Slider Download, HTML News Box For Your Website Free Download, java script news box For your Website, HTML CSS News Box Tutorial, HTML CSS News Box Example With Source code, HTML CSS Link Slider, HTML Slider Menu ,java script news box For your Website, HTML News box source Code example, News Slider   Here Is Example Of News Box slider for Your Website you can use it wiht PHP, ASP, ASP.NET, JSP,HTML 1.HTML Code  Save this code as index.HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title itemprop="name"></TITLE> <meta name="description" itemprop="description" content=""/> <META NAME="Keywords" CONTENT=""/>  <meta name=&quo

rowspan and colspan in html table

html table rowspan colspan tutoral, rowspan and colspan in html table, html table , html table video tutorial , html table with colspan and rowspan  html table rowspan colspan tutoral, rowspan and colspan in html table, html table , html table video tutorial , html table with colspan and rowspan  saving details Month Savings Savings for holiday! January $100 $50 February $80 click here to download html table colspan rowspan tutorial