p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   'grey out' or 'disable' an image (http://p2p.wrox.com/showthread.php?t=28022)

crmpicco April 12th, 2005 08:30 AM

'grey out' or 'disable' an image
 
Is there a way to 'grey out' or 'disable' an image?

For example i have this code:
Code:

<tr>
<td>
Status:
</td>
<td>
<img src="picco.jpeg">
</td>
</tr>

How can i 'grey-out' the image picco.jpeg, or have it appear to be 'disabled' like the text???

Picco




www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt

crmpicco April 12th, 2005 09:19 AM

Also discussed @:

http://www.codingforums.com/showthread.php?t=56782

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt

crmpicco April 12th, 2005 09:20 AM

yes i do want it to only occur under a condition, but i would kind of need it to be done with HTML, Javascript, ASP or whatever.

I think it can be done with ASP.NET, but I have yet to see it be done anywhere on the WWW with Classic ASP.

Thanks for all your help guys, have you got any other ideas?

Can it be done with javascript?

I found this page, but dont really know what the guy is trying to say:

---------------------------------------------

> <div id=s1 disabled>
> <button onclick="alert('1')">click me</button>
> <button onclick="alert('2')">click me</button>
> <button onclick="alert('3')">click me</button>
> </div>
>
> When I open this code in IE6 the buttons indeed appear grayed out
> (disabled), but surprisingly - they do respond to clicks, despite
> MSDN's explicit declaration...

That won't work in any browser other than IE. It's also invalid HTML.

> Does anybody know how can I still control the buttons state or
> enable/disable their mouse events in one command?

Use your original HTML and:

if( !document.getElementById ) {
if( document.all ) {
document.getElementById = function( id ) {
return document.all[ id ];
}
} else {
document.getElementById = function() {
return null;
}
}
}
function enableGroup( prefix, num, bool ) {
bool = bool || true;
for( var i = 1, e; i <= num; ++i ) {
e = document.getElementById( prefix + num );
if( e ) e.disabled = !bool;
}
}

calling the function

enableGroup( 'b', 3 )
or
enableGroup( 'b', 3, true )

to enable b1 through b3 and

enableGroup( 'b', 3, false )

to disable b1 through b3.

------------------------------------------

I have this setup:


Code:

<% if crm = true then %>
<div id="crm" disabled>
<img src="banner_vr.gif">
</div>
<% end if %>

But, i would like the image disabled or greyed-out if the ASP conditon is met as you mentioned. But as i say there are many images and this image will change every time (like eBay for example).

http://cgi.ebay.com/ws/eBayISAPI.dl...&Category=62136

(the image in left hand corner)

Any help is greatly appreciated!

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt


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

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