Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old September 21st, 2004, 10:29 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
quote:I need to use an image as a button since it is not a submit button
You can just use a plain button, instead of an image. It looks just like a submit button.

<input type='button' onclick='doSomething()' value='click' />

Quote:
quote:When the button has the focus, I need it to change shape for instance.
A normal button like I mentioned above has 3D effects just like the submit button (on most platforms, anyway).

However, you could dynamically change the src of the image to an image that looks like the first one, except that it's a different shape or color.

<input type='image' onmousedown='this.src="down_image.png"' onmouseup='this.src="up_image.png"' src='up_image.png' />

Let me know if either of these is what you need.

HTH,

-Snib <><
http://www.snibworks.com
There are only two stupid questions: the one you don't ask, and the one you ask more than once :-)
Reply With Quote
  #12 (permalink)  
Old September 21st, 2004, 10:40 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is not what I want.
I have three buttons:
     a submit button
     an image (up-arrow): when clicked, it goes up a list
     an image (down-arrow): when clicked, it goes down a list.
When the page is loaded, the focus is on the "down-arrow" button.
Now, I only want the down-arrow to change to "another-down-arrow" when the focus is on it.


Reply With Quote
  #13 (permalink)  
Old September 21st, 2004, 10:47 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I think I'm still missing something. Your up arrow, for instance. You want it to look different when the focus is on it, or when someone is clicking on it?

You can do onfocus, but usually people go for the onmousedown and onmouseup effects.

<input type='image' src='up-arrow.png' onfocus='this.src="another-up-arrow.png"' onblur='this.src="up-arrow.png"' />

Now do I understand?

-Snib <><
http://www.snibworks.com
There are only two stupid questions: the one you don't ask, and the one you ask more than once :-)
Reply With Quote
  #14 (permalink)  
Old September 21st, 2004, 10:55 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's right!!!!. Thank you so much!!!


Reply With Quote
  #15 (permalink)  
Old September 21st, 2004, 10:59 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now, instead of vchanging the shape of an image, how can I do almost the same thing but change the color?

Reply With Quote
  #16 (permalink)  
Old September 21st, 2004, 11:18 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Just change another-up/down-arrow.png to have a different color.

-Snib <><
http://www.snibworks.com
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
Reply With Quote
  #17 (permalink)  
Old September 21st, 2004, 11:27 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am sorry to bother again but I don't know how to modify the color of my image!!!


Reply With Quote
  #18 (permalink)  
Old September 21st, 2004, 11:57 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How would I do it ?


Reply With Quote
  #19 (permalink)  
Old September 21st, 2004, 03:42 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

What program did you use to create the image?

-Snib <><
http://www.snibworks.com
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
Reply With Quote
  #20 (permalink)  
Old September 22nd, 2004, 03:02 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did not have to create it, I already had a .gif. What I needed were 2 arrows in 3D (up and down). I would be nice to have the same one in red when the focus is on them.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re: color change jack_in_black ASP.NET 2.0 Professional 0 July 11th, 2006 07:24 AM
Rotating shape in VBA (not center of shape) Piblon Excel VBA 3 April 13th, 2006 04:04 AM
change link color swastikagaur Classic ASP Basics 1 March 11th, 2005 10:35 PM
Color change possability? rolandatem VB How-To 2 November 19th, 2004 03:52 PM



All times are GMT -4. The time now is 09:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.