Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Intro to JavaScripting and i dont know WTF i did wrong or what to do.

  1. #1
    I might..depend on you.. Lionx's Avatar
    Join Date
    May 2002
    Location
    Breezegale
    Posts
    4,221

    Default Intro to JavaScripting and i dont know WTF i did wrong or what to do.

    Ok my assignment that i need to do is basically:

    • Detect which Browser plus version you are using to view this page
    • Change the graphic color background automatically
    • Run a "banner" across the web page of at least three graphics or text messages…you might use the Word Art from Microsoft Word to create the graphics.
    and what i put in as my base source code so far is:

    Code:
    <HTML>
    <HEAD>
    <TITLE>Javascript Assignment #3 :O</TITLE>
    
    
    :love::love::love::love::love::love::love::love: langauge = "Javascript">
    function checkchoice(choice)
    
    {
    
    	if (choice == "backcolor" )
    	{
    		document.bgcolor = "green";
    	}
    }
    </script>
    
    </HEAD>
    
    <BODY BGCOLOR="red">
    
    <input Type ="checkbox" name = "checkselect" value = "backcolor" onclick="checkchoice(this.value)">Change Background to a different color<BR>
    
    OMG THIS IS TOO CONFUSING!
    </BODY>
    
    </HTML>
    First i dont know how to change the color of the background..it makes absolutely no sense, i copied most of this from the video instructions my instructor gave me for this online course..and it ends up in error...-_- So i dont even get a ballpark idea on what to do. Second of all...the rest of the stuff i have no idea what to put since he didnt demonstrate it on the videos...i really need help on this i spent 5 $#@%ing hours on this and i STILL dont get it reviewing all the stuff he taught in his video...what am i doing wrong here? ;-; How can i make this so it fulfills his requirements?

    My Youtube Page - Full of Capcom vs SNK 2 goodness!
    Check it out Nya~! @.@
    貓..貓..Yeh! X3

  2. #2
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    I don't quite understand what you mean by " run a banner." Does it need to be a scrolling banner, and does it have to be Javascript?
    Marquees will work fine for that, but only in IE.

    To change the colour of the background, I'd just use an onClick or an :bou::bou::bou::bou::bou::bou::bou:Over event.

    As for the browser and browser version info, you can use navigator.appName and navigator.appVersion, respectively.

    Here is a little page I threw together in about five minutes; I'm not sure if it's at all what you're trying to do though. I'd happily change it for you though.

    <div style="font-size: 11px;">
    <pre>
    &lt;html>
    &lt;head>
    &lt;title>hi2u&lt;/title>
    &lt;style type="text/css">
    body { font-family: Tahoma, Verdana;
    color: 9b89bd;
    }
    &lt;/style>
    &lt;/head>

    &lt;body bgcolor="#000000">

    &lt;center>
    &lt;a style="color: 68569a; font-family: Tahoma, Verdana; font-size: 20px; cursor: hand;" onClick="document.bgColor='white';">Change the background colour&lt;/a>
    &lt;br>&lt;br>&lt;br>
    &lt;a style="color: 68569a; font-family: Tahoma, Verdana; font-size: 20px; cursor: hand;" onClick="document.bgColor='black';">Change it back&lt;/a>
    &lt;br>&lt;br>
    &lt;center>

    &lt;script type="text/javascript">
    var name = navigator.appName
    var ver = navigator.appVersion
    document.write
    ("You are using " + name + ", " + ver + ".");
    &lt;/script>

    &lt;marquee scrollamount="7" width="100%" direction="left">Hi there.&lt;/marquee>
    &lt;marquee scrollamount="7" width="100%" direction="right">This only works&lt;/marquee>
    &lt;marquee scrollamount="7" width="100%" direction="left">in IE.&lt;/marquee>

    &lt;/body>
    &lt;/html>
    </pre>
    </div>

  3. #3

    Default

    I was trying to go through it with Lionx, but all I know is Visual Basics - which I studied around a year ago so sometimes it's a bit vague to me. Anyways, I think the background changing thing is what Lionx wanted...

    ...but I'm not sure about the others. I think he wanted to know how to do an image flip (it cycles through different images) and to tell the viewer of the website the version and name of the browser they are using.

    Correct me if I'm wrong Lionx. ^^


    "... and so I close, realizing that perhaps the ending has not yet been written."


  4. #4
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    Quote Originally Posted by Omecle
    I think he wanted to know how to do an image flip (it cycles through different images)
    Hmm, like a random ad banner that's displayed on loading the page, or a mouseover image flip, which will flip between two image :bou::bou::bou::bou::bou::bou::bou:Over?

  5. #5

    Default

    Quote Originally Posted by o_O
    Hmm, like a random ad banner that's displayed on loading the page, or a mouseover image flip, which will flip between two image :bou::bou::bou::bou::bou::bou::bou:Over?
    I'm guessing through a time interval.


    "... and so I close, realizing that perhaps the ending has not yet been written."


  6. #6
    I might..depend on you.. Lionx's Avatar
    Join Date
    May 2002
    Location
    Breezegale
    Posts
    4,221

    Default

    I think the first one is to somehow use javascript's built in functions to automatically display the version of your browser...i have no idea how to do that..he never told me.

    second one is the background color change. where i check a box, it changes color..then uncheck it goes back.

    Third is like...an automatic slide show i think...one pic stays there 5 secs...next one appears...and then repeats.

    I am going to try the above code later...late here...if you guys have ANY sugguestions at all please do help...i am tearing my hair off with this..i just dont know what i did wrong at all..

    My Youtube Page - Full of Capcom vs SNK 2 goodness!
    Check it out Nya~! @.@
    貓..貓..Yeh! X3

  7. #7
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    Ah, a slide show is fairly easy to do. Forget those marquees I posted before then, they aren't what you're looking for.
    Give me a couple of hours and I'll write you a slide show; I'm at school right now so I can't do it.
    Do you need to write a function for the background change? It's much quicker to use an onClick event and define the change inline.

  8. #8
    I might..depend on you.. Lionx's Avatar
    Join Date
    May 2002
    Location
    Breezegale
    Posts
    4,221

    Default

    I need to make a checkbox and then when i click it, it changes the color of the background...i am having alot of headache with this along with other classes...so i really really appreciate the help.. m(_ _)m Thanks so much.

    My Youtube Page - Full of Capcom vs SNK 2 goodness!
    Check it out Nya~! @.@
    貓..貓..Yeh! X3

  9. #9
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    Ok, here's a page I've made; the slideshow script is a bit temperamental, but I managed to get it going in Firefox and IE.

    Hope it helps.
    Attached Files Attached Files

  10. #10
    I might..depend on you.. Lionx's Avatar
    Join Date
    May 2002
    Location
    Breezegale
    Posts
    4,221

    Default

    All i have to say is..your god..x-x

    thanks so much, you are going to help me so much by letting me look at what you did and stuff...*bows* m(_ _)m

    My Youtube Page - Full of Capcom vs SNK 2 goodness!
    Check it out Nya~! @.@
    貓..貓..Yeh! X3

  11. #11

    Default

    Yeah, Face is awesome, just cause... he is He. Hope that helps you out Lionxy, I am sorry I couldn't help earlier. ^^


    "... and so I close, realizing that perhaps the ending has not yet been written."


  12. #12
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    Heh, no problem.

    The best piece of advice I can give about Javascript is to learn the hierachy of elements. That and to think logically in terms of order of things that need to happen; eg. for that slide show, the first step was to preload the images, the second was to define the function, the third was to place the image on the page, etc.

    Glad I could help.

  13. #13
    I might..depend on you.. Lionx's Avatar
    Join Date
    May 2002
    Location
    Breezegale
    Posts
    4,221

    Default

    Now he tells me that he needs it to change during the load time..-_- o shiet..so d00med..>>

    My Youtube Page - Full of Capcom vs SNK 2 goodness!
    Check it out Nya~! @.@
    貓..貓..Yeh! X3

  14. #14
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    xD How so?

    It sounds like something you'd need to put in the &lt;head> tag.

    Does it actually have to change while the page is loading, and display it? That would be pretty hard to do if the page was stored locally, unless you used some sort of loop to slow it down.

  15. #15
    I might..depend on you.. Lionx's Avatar
    Join Date
    May 2002
    Location
    Breezegale
    Posts
    4,221

    Default

    Load > Change color auto...i aint sure...he put a pop up window and you have to press ok to change it..>>

    My Youtube Page - Full of Capcom vs SNK 2 goodness!
    Check it out Nya~! @.@
    貓..貓..Yeh! X3

Posting Permissions

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