473,569 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i want a simple custom hiliting button...

hi!

I want to have a custom button change appearance when pressed and then
call a function and change back to its original appearance when released.

here's what i have now, which works mostly. "drop" is my handler for the
button, its argument tells me which button was pressed. i have a number
of these buttons and they are organized in a table.

there is a fair amount of superstition here, the result of many tiny
experiments i ended up with this which seems to work best:

<td>

<A HREF="javascrip t:drop(0)" onMouseDown="do cument.images[1].src = 'pressed.gif'"
onMouseOver="do cument.images[1].src = 'notpressed.gif '"
onMouseOut="doc ument.images[1].src = 'notpressed.gif '"
onMouseUp="docu ment.images[1].src = 'notpressed.gif '">

<IMG SRC="notpressed .gif" HEIGHT= "50" WIDTH= "50" ALIGN= "center" BORDER=0></a>

</td>
pressed.gif is the pressed button's appearance, likewise notpressed.gif
is the normal appearance.

i say this mostly works. there is something i am missing, because the
first press of the first button on a freshly loaded page is weird. and
it is different in different browsers.

in a newer Netscape, the first press first shows no button, then shows
the hilite button and then, when i release the button, it goes to
notpressed.gif. subsequently all buttons work perfectly.

in an older Netscape, the first presses don't work at all, it just shows
a dotted outline of the GIF, until i mouse furiously at a button for a
few strokes within a very short period of time. then all buttons
function perfectly.

in a newer IE, the fist press is a bit weird but all subsequent presses
are perfect, except i get a square hilite box around the button.

i would appreciate a push in the right direction.

-- rob
Jul 20 '05 #1
1 2826
Sounds like a caching issue to me, cache your images onload of the page then
the machine has the images when the user starts clicking.

Hope that helps, good luck.

Stu

PS also having a bunch of links forcing the use is bad for non JS users (i.e
your HREF="javascrip t:drop(0)" ), this won't work for non JS users.

"robert" <ra*@tiac.net > wrote in message news:3F******** *******@tiac.ne t...
hi!

I want to have a custom button change appearance when pressed and then
call a function and change back to its original appearance when released.

here's what i have now, which works mostly. "drop" is my handler for the
button, its argument tells me which button was pressed. i have a number
of these buttons and they are organized in a table.

there is a fair amount of superstition here, the result of many tiny
experiments i ended up with this which seems to work best:

<td>

<A HREF="javascrip t:drop(0)" onMouseDown="do cument.images[1].src = 'pressed.gif'" onMouseOver="do cument.images[1].src = 'notpressed.gif '" onMouseOut="doc ument.images[1].src = 'notpressed.gif '" onMouseUp="docu ment.images[1].src = 'notpressed.gif '">
<IMG SRC="notpressed .gif" HEIGHT= "50" WIDTH= "50" ALIGN= "center" BORDER=0></a>
</td>
pressed.gif is the pressed button's appearance, likewise notpressed.gif
is the normal appearance.

i say this mostly works. there is something i am missing, because the
first press of the first button on a freshly loaded page is weird. and
it is different in different browsers.

in a newer Netscape, the first press first shows no button, then shows
the hilite button and then, when i release the button, it goes to
notpressed.gif. subsequently all buttons work perfectly.

in an older Netscape, the first presses don't work at all, it just shows
a dotted outline of the GIF, until i mouse furiously at a button for a
few strokes within a very short period of time. then all buttons
function perfectly.

in a newer IE, the fist press is a bit weird but all subsequent presses
are perfect, except i get a square hilite box around the button.

i would appreciate a push in the right direction.

-- rob

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1907
by: Rudy | last post by:
Hello all, I'm sure there is, just can't figure it out. I have the RGB code and the color number. But the color doesn't exsist in Visual studio.net. Can I add this color to the system pallet it self, so I can add the custom color to fonts? I need to match as close as possible to the color I was given. Thanks Rudy
1
3541
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be modular and work across forms and sub-forms. My previous code was taken from the Access Expert Solutions 97 (Leszynski) many years ago. As my database...
6
3245
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A query-string flag is used to indicate to the page whether it should instantiate a new instance of the object or access an existing instance from the...
0
1730
by: csharpnb | last post by:
Hi all, I've been studying C#/.NET 2.0 for a couple of hours a week for the past couple of weeks. I feel the need to build a somewhat simple Windows application that would accomplish a somewhat simple task, in order to put my knowledge to test, and brush it up further. Besides, this application, if successfully built, could find its use in...
1
1764
by: Chris Dunaway | last post by:
I have created a simple Extender Provider and when I drop it onto a form, it appears in the component tray, but none of the controls it is supposed to provide a property for show the property in the PropertyGrid! Here is the class. The GlassButton is a custom button control that derives from button and I just do some custom painting. I am...
1
4778
by: rn5a | last post by:
I have created a custom control button which when clicked displays a message in the JavaScript alert dialog. I could successfully compile the VB class file into a DLL & also could add it to the Toolbox in Visual Web Developer 2005 Express Edition but the alert message isn't popping up when I am implementing this control in an ASP.NET page &...
0
1383
by: rn5a | last post by:
A custom control is derived from the WebControl class & encapsulates a TextBox & a Button. When the Button is clicked, the user is shown the JavaScript confirm dialog with the 'OK' & 'Cancel' buttons. If the user clicks 'OK', the TextBox gets populated with 'true' & if 'Cancel' is clicked, the TextBox gets populated with 'false'. Note that...
4
2840
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information when data in A is updated. I know cutom events in wxpython may work. But I found no material paricularly helpful :(
1
2964
by: deepapanch | last post by:
Hi All: I am new to C#. Have created a simple outlook add-in, which adds a command bar in Outlook. On click of the button, I would like to load the a simple dialog with a Text Box and a Button. I would like to populate the textbox with a value, before displaying it. To accomplish this, I tried creating a custom control (Test Control)
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.