Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old November 22nd, 2007, 01:27 PM   #1
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Javascript for Final Project

Two of my final project requirements are:

1-Incorporate the use of a rollover image using javascript or flash
2-Incorporate javascript other than a page counter

I am building a youth website for this final project and wondered what could use some javascript?

Does anyone know where I can find tutorials on creating a rollover image with javascript?
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2007, 01:35 PM   #2
Elite Veteran
 

Join Date: Jul 2007
Location: Webforumz 24/7
Age: 17
Posts: 3,799
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Rep Altering Power: 0 alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all
Re: Javascript for Final Project

Image swapper.
How about some snazzy AJAX or can you not use PHP?
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2007, 01:38 PM   #3
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

I am sure we can, but I don't know any php. What is AJAX?
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2007, 01:43 PM   #4
Elite Veteran
 

Join Date: Jul 2007
Location: Webforumz 24/7
Age: 17
Posts: 3,799
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Rep Altering Power: 0 alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all
Re: Javascript for Final Project

It's for interaction between the server and user without reloading the page basically.
I wrote a resource thread, maybe you can find something you like there. It also has some links to AJAX tutorials.
http://www.webforumz.com/javascript-...-resources.htm
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2007, 03:35 PM   #5
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

Try using something from mootools. They've got some pretty amazing stuff that will definitely make your site interactive...
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2007, 03:39 PM   #6
Elite Veteran
 

Join Date: Jul 2007
Location: Webforumz 24/7
Age: 17
Posts: 3,799
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Rep Altering Power: 0 alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all alexgeek is a name known to all
Re: Javascript for Final Project

Or do you have to make your own script?
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2007, 03:44 PM   #7
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

If you have to make your own, asking us to help you with it is cheating, in a way...
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 12:40 AM   #8
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

No we don't. We didn't learn Javascript, just a tiny tutorial that never covered what she's asking of us.
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 12:41 AM   #9
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

In that case, try mootools. There are some pretty awesome things there...
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 12:43 AM   #10
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

Honestly I have no clue where to get started or what to do. I have visited the site, but I got lost and confused.
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 12:49 AM   #11
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

This is what my Prof. Wants:

1-Javascript--In this project, we will be adding some interactive elements to your web page. Specifically, you need to incorporate the use of JavaScript or Java Applets into this project. Don't worry. You don't need to know how to program in JavaScript or Java in order to use these in your pages. There are huge libraries of Java and JavaScript code that are available to web designers like yourself. All you have to do is insert the code into your pages and perhaps moidfy it slightly in order to meet your needs.

2-Rollover Images--
In this project, we will be adding some rollover images. Specifically, you can use an image editor to create two versions of a button or a navigation bar: one representing the button "at rest" and another version of the button that will be displayed with the mouse is "rolled over" the image. You can do this with JavaScript or with Flash.
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 01:07 AM   #12
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

1. Try the following library: Dynamic Drive
2. Javascript rollover image script

Have fun!
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 05:26 AM   #13
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

I couldn't get it to work, could anyone tell me what's wrong with this:

Code:
<script language="javascript" type="text/javascript">

normal_image = new Image();
normal_image.src = "Untitled-1.jpg";

mouseover_image = new Image();
mouseover_image.src = "Untitled-2.jpg";


<!-- repeat the 4 lines above for any subsequent images. -->

function swap(){
if (document.images){
for (var x=0;
x<swap.arguments.length;
x+=2) {
document[swap.arguments[x]].src = eval(swap.arguments[x+1] + ".src");
}
}
}
</script>
<!-- END JAVASCRIPT -->

<a href="page.html" onMouseOver="swap('Untitled-1.jpg','Untitled-1.jpg')" 
onMouseOut="swap('Untitled-1.jpg','Untitled-2.jpg')">
<img name="Untitled-1" src="Untitled-1.jpg" border="0"></a>
I replaced the names just like they asked.
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 09:35 AM   #14
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

OK. I see what the problem is. Try this for html but keep the javascript the same:
HTML Code:
<a href="page.html" onMouseOver="swap('graphic','mouseover_image')" onMouseOut="swap('graphic','normal_image')">
<img name="graphic" src="path/img.gif" border="0"></a>
The onmouseover and onmouseout values were switched. I named the img "graphic". You can change it, but only in those three places!

Last edited by Stuart; November 23rd, 2007 at 09:38 AM..
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 09:38 AM   #15
Elite Veteran
 

Join Date: Jan 2007
Location: You know where
Age: 32
Posts: 4,607
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all
Re: Javascript for Final Project

Moving to JS forum!
karinne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 09:39 AM   #16
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

OK, no problem! Seems more appropriate...
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 02:49 PM   #17
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

I have some questions,( I still can't seem to figure it out)

Does the image have to have a .gif extension?

What must I replace here: (does mouseover image mean the image when i hover?)

Code:
onMouseOver="swap('graphic','mouseover_image')



and here: (does normal image mean the original state?)
Code:

Code:
onMouseOut="swap('graphic','normal_image')

thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 03:25 PM   #18
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

Ok, let me explain. normal_image is the original state, and mouseover_image is the rollover state. onmouseover means 'when the mouse is over it' and onmouseout means 'when the mouse leaves it', 'it' being whatever the attributes are being applied to, in this case, an anchor. Now, for the code I posted, you don't have to change anything. The only thing you need to change is the path of the image in the javascript. The image does not need to be a GIF image, it can be JPG, PNG, anything you want.
Here is the entire code again. Copy and paste it into your html document, but don't change anything except the image path.

javascript:
Code:
<script language="javascript" type="text/javascript">

normal_image = new Image();
normal_image.src = "Untitled-1.jpg";

mouseover_image = new Image();
mouseover_image.src = "Untitled-2.jpg";


<!-- repeat the 4 lines above for any subsequent images. -->

function swap(){
if (document.images){
for (var x=0;
x<swap.arguments.length;
x+=2) {
document[swap.arguments[x]].src = eval(swap.arguments[x+1] + ".src");
}
}
}
</script>

HTML: (don't forget to change the img src to the normal_image path!)
HTML Code:
<a href="page.html" onMouseOver="swap('graphic','mouseover_image')" onMouseOut="swap('graphic','normal_image')"><img name="graphic" src="path/img.gif" border="0"></a>
That should do it. If you have anymore questions, just ask.


Last edited by Stuart; November 23rd, 2007 at 03:38 PM..
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 03:35 PM   #19
Reputable Member
 

Join Date: Oct 2007
Location: At my house
Age: 23
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 thewebkid is on a distinguished road
Re: Javascript for Final Project

Wow ok thanks a lot. It worked well. I guess I will just have to take more time to understand this.
thewebkid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 23rd, 2007, 03:37 PM   #20
Highly Reputable Member
 

Join Date: Sep 2007
Age: 17
Posts: 716
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Stuart has a spectacular aura about Stuart has a spectacular aura about
Re: Javascript for Final Project

So it's working now, right? Do you have a javascript for the other part of the assignment, or are you still looking?
Stuart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Advice please about final project lisafelst12 How is this done? 10 November 11th, 2007 07:42 AM
Final Project thewebkid How is this done? 19 October 24th, 2007 04:39 PM
Ideas for final year multimedia project kooben Classic ASP 7 April 30th, 2005 03:14 PM


Search Engine Optimization by vBSEO 3.2.0 RC8