HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 1st, 2000, 09:56 PM
Terry Terry is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 1999
Location: Wichita Falls, TX
Posts: 9 Terry User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've got a script that creates a drop down menu with a button click. I want to be able to collapse the menu with a mouse click anywhere on the document. How do I capture that? Help a rookie would ya?

Reply With Quote
  #2  
Old June 4th, 2000, 06:05 AM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
The script below pops up an alert box on a right mouse click or on a hold left/click right sequence. You can replace the alert function with whatever you need to collapse your menu. If you really want to collapse the menu with the left button as well (really?), you can add those button strokes.

RKM


<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
// block the right mouse click on the page
var message="YOUR MESSAGE"

function click(e) { //3.0
if (document.all) {
if (event.button == 2 | | event.button == 3 | | event.button == 6 | | event.button == 7) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</SCRIPT>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Capture mouse click on document window


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway