...

View Full Version : onMouseover command??



Plystire
01-12-2003, 08:29 PM
I had an idea to have a nice animated gif pop up when the user had their mouse over a specific button. and then play another gif (possibly the first one in reverse) when the mouse leaves the button.

how would i go about doing this?

~PlystirE~

cg9com
01-12-2003, 11:47 PM
this is the mouseover event inside of an anchor link.
button 2 is your mouseover image, button 1 is the original.
change "image" in the code to another variable if you use it more than once in one page.
this isnt a very effecient way of going about it, but its simple.


<a onmouseover="document.image.src='button2.gif'"
onmouseout="document.image.src='button1.gif'">
<img src="button1.gif" border="0" name="image"></a>

Plystire
01-13-2003, 12:35 AM
ok i made a gif the way i want it, but it took me a LONG time to make it...i would hate to make one like it for EVERYsingle button...

i want to make a function that will...

1. resize an image to the size i want
2. draw green and darkgreen lines towards the corners of that image

thx

~PlystirE~

Plystire
01-15-2003, 05:34 AM
so no one wants to help me, or does no one know how to do this?

i really need this to finish my site. I have not found a tutorial anywhere discussing EXACT image location and/or how to do this all using javascript.

~PlystirE~

cg9com
01-15-2003, 05:50 AM
josh maybe i just misunderstand you
lines around the corners? how about a border?

Plystire
01-15-2003, 06:33 AM
not "around" corners...i want a line to be drawn...ANYwhere for all i care...just as long as i know how it was done :)

anyone know programming? like BASIC? something like

LINE (x,y)-(x2,y2), color

which would draw a line from x,y to x2,y2 which is colored whatever color was put in the color spot

hope this helps to clear things up:D

~PlystirE~

cg9com
01-16-2003, 06:15 AM
you could create a transparent image of a line and absolutely position it down to the pixel.

or maybe you could learn something from this script?
http://www.dynamicdrive.com/dynamicindex13/crosshair.htm

Plystire
01-17-2003, 01:48 AM
:( i wasn't really hoping to have to create an image for each line

what if i wanted the line to go from the top left to the bottom right or the top right to the bottom left? iw ould have to make an image for each case:(

i was going to have my image loop through a for loop or two and have it resized accroding to those...then have it draw the line to the new corner locations of the image.

/_/
|_|/

i guess sorta like that:o

cept better looking

~PlystirE~

ez4ne12c
01-17-2003, 04:21 AM
I have done stuff like that with netpbm and ImageMajick but these are unix commands, i used perl to do this stuff

Grab any (gif) image off the web and
cut,
resize,
paste text or another image inside it,
change color map and set transparency color.

If you havent got server side access, you gonna have to use something else but if you have access to a server this is a solution.
ez

oh and if you want to reconstuct your gifs into animatied gifs you might wanna try gifmerge which is also a unix command line animated gif constructor which if i recall supports transparent colors...

cg9com
01-17-2003, 07:30 PM
Originally posted by ez4ne12c

If you havent got server side access, you gonna have to use something else but if you have access to a server this is a solution.

PHP can use the gd library (http://www.boutell.com/gd)

RoyW
01-17-2003, 08:20 PM
ok i made a gif the way i want it, but it took me a LONG time to make it...i would hate to make one like it for EVERYsingle button...

i want to make a function that will...

1. resize an image to the size i want
2. draw green and darkgreen lines towards the corners of that image

thx


A picture is worth a thousand words.
Why not post the animated GIF and then people can see what you are aiming for and if it is possible in JavaScript.
Just in case
Here is a link to my Optimised Animated Rollovers (http://www.roy.whittle.com/tutorial/tutorial2.html) tutorial.

mordred
01-17-2003, 09:38 PM
Drawing lines from arbitrary points to other arbitrary points in a document is not in the scope of normal client-side JavaScript. You could however rely on a plugin and it's scripting abilities, and then you can chose between either Flash or SVG. But then they don't integrate as nicely into the rest of your document.

ez4ne12c
01-17-2003, 09:39 PM
I thought php was server side...:confused:

anyways as i said perl is "A" solution..
:)

RoyW.. making animated gifs is hard work no matter how you do it.. unless you have some repetative tasks to do on images that can be automated or interactive tasks that a 'user' can perform.. you are gonna have to :eek:bite the bullet:mad:
ez :D

ps. next on my todo list
- gain a dangerously small amount of knowledge about php

mordred
01-17-2003, 09:53 PM
Originally posted by ez4ne12c
I thought php was server side...:confused:


That's correct, although PHP-GTK and PHP-CLI are blurring the line somewhat. And that's why cg9com suggested a different solution for drawing lines on server-side, in case the original poster hasn't got Perl. :)

ez4ne12c
01-17-2003, 10:04 PM
Yeah ive gotta get into php:thumbsup:,
sometimes perl is a bit like looking at line noise:(:confused:..

I didnt know that php use gd,
unfortunately my sys admin didnt want to have to install gd... grrrrrrr... last time i asked....

ez
ps cg9com that gd link looks good .. thanks

cg9com
01-17-2003, 11:25 PM
Originally posted by ez4ne12c

ps cg9com that gd link looks good .. thanks
:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum