Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-04-2002, 01:18 AM   #1 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
jscript rollovers

in relation to ur post here: http://www.netwerkin.com/cgi-bin/ult...;f=6;t=000120, milano, its very simple if u are only using the same pictures for on an off

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

function on(x)
{
x.src="images/on.gif";
}

function off(x)
{
x.src="images/off.gif";
}

</script>

<a href="link.com">
 <img onmouseover="on(this)" onmouseout="off(this)" />
</a>
and its that easy
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-04-2002, 01:20 AM   #2 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
not to mention that "JScript" and "JavaScript" are different things as well
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-04-2002, 01:25 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
how about that! i don't even have to as a question and it is answered... this is a reverse thread i guess =)

thanks a lot . after i posted that i was so fusterated i just made static pictures cause i have more important things to waste hours on than graphics.

haven't tried it yet, but i'll let you know how it turns out .. thanks alot!!
sde is offline   Reply With Quote
Old 08-04-2002, 01:40 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
Thank You so much!

that is exactly what i was looking for =)

i should really take some time to learn Javascript

thanks again.
sde is offline   Reply With Quote
Old 08-04-2002, 02:49 AM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
Learn Javascript? I didn't know you had to learn it.. Isn't it more what you just hack from other sites, where you see it, and thinks it somethig you would like to see on your site aswell.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 08-04-2002, 11:32 AM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
hehe, that's the method i've been using redhead .. it's goten me this far, .. except for last night.

here's one for whoever is listening .. eh hem .. ( abc ? =) )

so now i use that script. that script changes the rollover when you rollover that image. i mean it is not required to be a link for the rollover to work.

i am using it like this:
Code:
<a href="link.com">
 <img onmouseover="on(this)" onmouseout="off(this)" /> Text Link Here</a>
The text link is using a rollover that is triggered by the style sheets. so when the user rolls over the image, the text changes color because it's all in the same link... but, if the user rolls over the text, the image switches back ( or doesn't turn on at all if they rollover the text first )

is there a way to make the image switch if anything within the link is rolled over? am i asking too much ?
sde is offline   Reply With Quote
Old 08-04-2002, 02:23 PM   #7 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
yerp, that can be done in a tiny_bit more complex way, but then you'll have to start generating (given that its done dyncamicaly right?) names for your images..., etc. eg.

the <script></script> tags stay the same
but
change the other stuff to:

Code:
<a href="link.com" onmouseover="on(img1)" onmouseout="off(img1)">
<img id="img1" src="link.png" />
</a>

get it? so the image is just referred to by its ID, so you can change it from anywhere.

goodluck
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-04-2002, 03:33 PM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
got it, thanks again, it works perfect now =)
sde is offline   Reply With Quote
Old 08-04-2002, 11:14 PM   #9 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
no probs
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-05-2002, 07:36 AM   #10 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
javascript is really frusterating if you are trying to do anything semi-complex. things that should work dont (sometimes). its ghetto as hell.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 08-06-2002, 04:31 PM   #11 (permalink)
rdove
Masked Moderator
 
rdove's Avatar
 
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
rdove is on a distinguished road
AHHHHHHHHHHH!!!


JAVASCRIPT!!!!!


GET IT AWAY, GET IT AWAY!!

No really I cannot stand to use Javascript or JScript for anything. I never works on all platforms and it always a pain.

I can accomplish anything from Jscript and Javascript with VBScript and make it work with every platform.
__________________
~Ryan

rdove is offline   Reply With Quote
Old 08-06-2002, 05:59 PM   #12 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
Quote:
Originally posted by rdove
I can accomplish anything from Jscript and Javascript with VBScript and make it work with every platform.
i didn't think vbscript worked for most netscape or linux browsers
sde is offline   Reply With Quote
Old 08-08-2002, 06:55 PM   #13 (permalink)
rdove
Masked Moderator
 
rdove's Avatar
 
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
rdove is on a distinguished road
I don't see why not, everything is executed on the server side, it has nothing to do with the browser at all.
__________________
~Ryan

rdove is offline   Reply With Quote
Old 08-08-2002, 07:50 PM   #14 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
erm

javascript is run client side

vbscript and jscript can ALSO be run client site, asp is generally written in VBScript which is run server side.

...
......
..........
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-12-2002, 08:37 PM   #15 (permalink)
Mytch
Registered User
 
Join Date: Aug 2002
Posts: 2
Mytch is on a distinguished road
I think that JavaScript is excellent. We've made a WYSIWYG replacement for the textbox in PHP complete with a JavaScript + PHP API and it works a charm.

I wont advertise it here, but email me at mitchell@siteworkspro.com if you want the link to try the demo
Mytch is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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



All times are GMT -8. The time now is 12:09 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting