|
 |
|
 |
 |
08-04-2002, 12:18 AM
|
#1 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
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.
|
|
|
08-04-2002, 12:20 AM
|
#2 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
not to mention that "JScript" and "JavaScript" are different things as well 
__________________
-- bloomberg.
|
|
|
08-04-2002, 12:25 AM
|
#3 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,397
|
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!!
__________________
|
|
|
08-04-2002, 12:40 AM
|
#4 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,397
|
Thank You so much!
that is exactly what i was looking for =)
i should really take some time to learn Javascript
thanks again.
__________________
|
|
|
08-04-2002, 01:49 AM
|
#5 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
|
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.
|
|
|
08-04-2002, 10:32 AM
|
#6 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,397
|
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 ?
__________________
|
|
|
08-04-2002, 01:23 PM
|
#7 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
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.
|
|
|
08-04-2002, 02:33 PM
|
#8 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,397
|
got it, thanks again, it works perfect now =)
__________________
|
|
|
08-04-2002, 10:14 PM
|
#9 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
no probs 
__________________
-- bloomberg.
|
|
|
08-05-2002, 06:36 AM
|
#10 (permalink)
|
|
$_['Your_Mom'];
Join Date: May 2002
Location: Santee
Posts: 627
|
javascript is really frusterating if you are trying to do anything semi-complex. things that should work dont (sometimes). its ghetto as hell.
|
|
|
08-06-2002, 03:31 PM
|
#11 (permalink)
|
|
Masked Moderator
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
|
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
|
|
|
08-06-2002, 04:59 PM
|
#12 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,397
|
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
__________________
|
|
|
08-08-2002, 05:55 PM
|
#13 (permalink)
|
|
Masked Moderator
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
|
I don't see why not, everything is executed on the server side, it has nothing to do with the browser at all.
__________________
~Ryan
|
|
|
08-08-2002, 06:50 PM
|
#14 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
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.
|
|
|
08-12-2002, 07:37 PM
|
#15 (permalink)
|
|
Registered User
Join Date: Aug 2002
Posts: 2
|
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 
__________________
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 06:41 PM.
|
Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle
|
 |
|