joebob wrote:
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:40***************@agricoreunited.com...
joebob wrote:
> The following script if run in Internet Explorer
shoulddisplay > a thumbview of a webpage that you point it to.To
test it, > replace test.htm with a valid html file. The
problem I'm having > is that I can't get onclick tofire on the rendered
Thumbview > object. What's strangeis that onmouseover fires.
Can anyone > see a way?<html><head><title>test</title></head>
> <body onload="Init()">
> <a onclick=alert() href="file:///C:/test.htm">
> <object id="Thumbview"
>
classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92" > width=120 height=100 onclick=alert()>
> </object><br><br>this works
> </a>
> <script>
> function Init(){
> Thumbview.displayFile('C:\\test.htm');
> }
> </script>
> </body></html>
onclick and ondblclick just aren't honored by that
ActiveX
component. You can probably get onmousedown working,
you'll just
have to set it up so that it doesn't fire repeatedly.
Something like:
Thumbview.onmousedown = function() {
if (!this.mouseDownFired) {
this.mouseDownFired = true;
// do whatever
return true;
}
return false;
}
Hi Grant, I discovered that onmousedown works. Also in
conjunction with Overlib which is pretty cool. I haven't done
anything to ensure that it doesn't fire repeatedly, but I
haven't found that to be a problem. Can you tell me what could
cause that to occur? Thank you
By "fire repeatedly" I mean that the native behavior of the
operating system causes an event like "onmousedown" to fire over
and over again at say, 500ms intervals because the native
behavior of the operating system sends an event every 500ms when
a mouse button is held down. If the onmousedown event doesn't
fire repeatedly if you hold the mouse button down then it's fine.
I wasn't sure if it did. Using an alert() to test made it hard to
determine if the event was firing repeatedly.
Good examples of "repeatedly firing" events are "onkeydown" or
"onkeypress", which _do_ fire over and over again when you hold a
key down. A simple example of this is (IE only):
<form>
<input type="text" onkeydown="putInTa(this);">
<textarea name="output"></textarea>
</form>
<script type="text/javascript">
function putInTa(inp) {
inp.form.elements['output'].value += window.event.keyCode;
}
</script>
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available
at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html