[thelist] Changing style.backgroundImage of a submit button in js?

Dan Parry dan at virtuawebtech.co.uk
Fri Jan 13 10:11:47 CST 2006


Strips the quotes from the URL() declaration

I think CSS standards say the URL shouldn't be quoted

Worth a try :)

Dan
--

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Tom Dell'Aringa
Sent: 12 January 2006 21:43
To: thelist
Subject: [thelist] Changing style.backgroundImage of a submit button in js?

Boy, I'm mr. Question today. I'm trying to do a seemingly simple thing -
change the background image of a submit button on mouseover (or mousedown,
doesn't matter). I wouldn't normally do such a thing, but long story short,
I have to in order for our kiosk to do what we want it to.
 
Anyway, I have this code:
 
<input type="submit" name="helpme" style="background:
url('/images/btn-helpme.gif'); width: 351px; height: 80px; border: 0;"
value="" onmouseover="kbutHitState(this);" />
 
with the function:
 
function kbutHitState(oButton)
 {
  oButton.style.backgroundImage = "url(/'images/btn-helpme_on.gif')";
 }
 
This works fine in FF, but I get a script error in IE: "invalid argument".
 
Does IE not support the access of the backgroundImage property on a submit
input? The kluginess(tm) of this is just a-killin me.
 
Tom
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

__________ NOD32 1.1363 (20060112) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com





More information about the thelist mailing list