www.webdeveloper.com
Results 1 to 2 of 2

Thread: image in frame along with javascript

  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Exclamation image in frame along with javascript

    hello everyone...i am working on my web project and i have to submit it to my faculty by 5th of Dec. i am new to javascript. i am using frames and i have set a new page as its target. in that new page i have used javascript for text and i want to change the font face size of the text and also i want to put an image along with the text to the right side of the text.. and i am unable to get that.. moreover the background image is also not working..
    i am posting the complete code here..
    kindly help me out with this...

    the code is-
    <html>
    <head>


    </head>
    <body background="twitter-snowred-bkgd-lg.gif">
    <!-- START OF SCRIPT -->
    <b>
    <font size="5">
    <script>




    var text="<b>NAINITAL..</b>"
    var speed=80




    if (document.all||document.getElementById){
    document.write('<span id="highlight">' + text + '</span>')
    var storetext=document.getElementById? document.getElementById("highlight") : document.all.highlight
    }
    else
    document.write(text)
    var hex=new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
    var r=1
    var g=1
    var b=1
    var seq=1
    function changetext(){
    rainbow="#"+hex[r]+hex[g]+hex[b]
    storetext.style.color=rainbow
    }
    function change(){
    if (seq==6){
    b--
    if (b==0)
    seq=1
    }
    if (seq==5){
    r++
    if (r==12)
    seq=6
    }
    if (seq==4){
    g--
    if (g==0)
    seq=5
    }
    if (seq==3){
    b++
    if (b==12)
    seq=4
    }
    if (seq==2){
    r--
    if (r==0)
    seq=3
    }
    if (seq==1){
    g++
    if (g==12)
    seq=2
    }
    changetext()
    }
    function starteffect(){
    if (document.all||document.getElementById)
    flash=setInterval("change()",speed)
    }
    starteffect()
    </script>

    <!-- START OF SCRIPT -->
    <h2>
    <script language="JavaScript1.2">


    var message="CITY OF LAKES..."
    var neonbasecolor="PINK"
    var neontextcolor="RED"
    var flashspeed=100
    var n=0
    if (document.all||document.getElementById){
    document.write('<font color="'+neonbasecolor+'">')
    for (m=0;m<message.length;m++)
    document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
    document.write('</font>')
    }
    else
    document.write(message)

    function crossref(number){
    var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
    return crossobj
    }

    function neon(){

    if (n==0){
    for (m=0;m<message.length;m++)
    crossref(m).style.color=neonbasecolor
    }

    crossref(n).style.color=neontextcolor

    if (n<message.length-1)
    n++
    else{
    n=0
    clearInterval(flashing)
    setTimeout("beginneon()",1500)
    return
    }
    }

    function beginneon(){
    if (document.all||document.getElementById)
    flashing=setInterval("neon()",flashspeed)
    }
    beginneon()


    </script>
    </h2>
    </font></b>
    <img src="273064_CreateAgif.gif" align="right" height="20%" width="60%">
    </body>
    </html>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <style type="text/css">
    body {background:white url(twitter-snowred-bkgd-lg.gif) no-repeat top center;}
    </style>
    http://www.w3.org/TR/CSS2/colors.html#background
    Last edited by Fang; 12-02-2010 at 08:47 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles