PDA

View Full Version : Help menu(like IE help menu(pressing F1)



raju
04-10-2007, 12:57 PM
Dear friends

I am writing help menu(example when we are useing internet explorer at that time we suppose to press F1,at thime one help menu appear, that type of the help menu I am writing(Javascript)any one having the script pl let me know

Thanks inadvance
Rgds
GR(henfin@gmail.com)

thetestingsite
04-11-2007, 01:25 AM
Do you mean something like this:

http://dhtmlgoodies.com/index.html?whichScript=slide_in_pane

Demos:
http://dhtmlgoodies.com/scripts/slide-in-pane/slide-in-pane-d2.html
http://dhtmlgoodies.com/scripts/slide-in-pane/slide-in-pane.html
http://dhtmlgoodies.com/scripts/slide-in-pane/slide-in-pane-d3.html
http://dhtmlgoodies.com/scripts/slide-in-pane/slide-in-pane-d4.html

Hope this helps.

raju
04-11-2007, 09:36 AM
Dear friend(thetestingsite)

Thanks for your reply. your examples are something different but totally new. please open your internet explorer than just you press F1, now your doubt will be clear.

once again thanks for you, real efforts taken by you
Rgds
GR
India

tech_support
04-11-2007, 09:58 AM
I don't think that's possible.

Just a simple "Help" link would do.

raju
04-11-2007, 10:10 AM
Dear Mr Peter

Thanks for your reply. Do u have any javascript based coding which is related to my requirments?

Thanks once again
Rgds

GR(henfin@gmail.com)
India

tech_support
04-11-2007, 10:17 AM
Nope. [F1] is reserved to the system.

codeexploiter
04-11-2007, 10:34 AM
Try the following code (This works only in IE not in Firefox)



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onhelp="javascript: alert('hello');return false;">
</body>
</html>


This proves that you can trap F1 key.

codeexploiter
04-11-2007, 11:21 AM
Here is a solution based on Yahoo User Interface JavaScript framework which illustrates the trapping of F1 key both in IE and Firefox. Tested in IE 7 and Firefox 2.0.0.3



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://yui.yahooapis.com/2.2.0/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.2.0/build/event/event-min.js"></script>
<script type="text/javascript">

document.focus; //Focusing on the document is important as the F1 key trapped is based on the document object.

function isexplorer(){
if(navigator.appName.indexOf('Microsoft')!=-1)
return true;
else
return false;
}
YAHOO.util.Event.addListener(document, "keydown", processKeyDown); //This listener listens for keydown event.

document.onhelp = new Function("return false;"); // To disable default help in IE

function processKeyDown(evnt) {
if ( evnt == null )
evnt = event;
if ( evnt.keyCode == 112 ) //F1
{
help(); // Insert the help function calling or script statement here

if(isexplorer()== false)
{
evnt.preventDefault(); // disable default help in Firefox
}
return false;
}
}

function help()
{
//Handles the help part
alert('This is the help function');

}
</script>
</head >
<body>
<h2 style="color:blue;">F1 Key Press Trapping Demo</h2>
</body>
</html>



In the above code the required JS files is being accessed directly from Yahoo's UI server.

tech_support
04-12-2007, 03:00 AM
But that would be a bit stupid to do right?

What if someone wants to access the browser help file?
What about if someone has JS disabled?

codeexploiter
04-12-2007, 03:23 AM
But that would be a bit stupid to do right?
I personally feel it is better to not override system settings but it is my opinion.


What if someone wants to access the browser help file?
They can/have to access the browser help file through the Help menu in the browser window.


What about if someone has JS disabled?
This applies to all the scripts based on the JavaScript. If the user disables the JS then they won't be able to run their JavaScript in their browser. I still feel that the usage of JavaScript is somewhat ambiguous as the developer don't know whether the script is going to be executed in the client end successfully or not as it is based on client's browser settings.

raju
04-12-2007, 12:23 PM
Dear my friends(Peter,Robert J. Collier,thetestingsite(Sorry I dont know your name)

Thanks for efforts taken by you(all).

The above scripts are not working, you are absolutely correct F1 reserved for system. When I am going to click the particular link , the link(eg :- help) will open the help file( It should be looking like a F1 help).

Anybody having the scripts with (JS) file please let me know

Once again thanks those all

Rgds
GR(henfin@gmail.com)

:)

mburt
04-12-2007, 01:23 PM
Personally, I think anything involving system specific components (such as the F1 help window) shouldn't be tampered with. If they're meant to be a help window for the browser, that's what it should be.
As originally posted, a link, even a pop-up window would be suffice.
Just my two cents.

raju
04-13-2007, 10:01 AM
Dear Mr Peter, Mr Robert J. Collier, & Mike


Thanks for your continuous support

Actually I am not try to change the system file. I am designing a web site, in that I want add file which is like a F1 help file so that the visitors can easily know many things without clicking another hyper link
once again my sincere to Peter, & Mr Robert J. Collier, & Mike

Thanks
Rgds
GR (henfin@gmail.com)