Dranew New Member
Posts: 10 Status: Offline Gender: Male Location: Michigan, U.S.A. Age: 37 Joined:
pmwwwmsnyahooaim | Graphical confirm logout (11th Mar 10 at 3:40am UTC) | | Its been awhile, so I thought I'd write up a quick code
Cross Browser: Yes, tested in FF 3.6 and IE 8.0.6 Preview: -Clicky- Description: Similar to the usual 'confirm logout' it asks if you would like to log out or not, but this one uses images!
Place both in Main Header
Style:
Code: - <style>
- #logOff {
- position: fixed;
- z-index: 2;
- width: 300px;
- height: 220px;
- top: 50%;
- left: 50%;
- margin: -100px 0 0 -150px;
- padding: 0;
- }
-
- #logOff h3 {
- margin: 0 0 20px 0;
- padding: 0;
- }
-
- #logOff ul {
- list-style: none;
- margin: 0;
- padding: 0;
- }
-
- #logOff ul li {
- margin: 0 0 20px 0;
- }
- </style>
-
dont really need to edit the style much unless you know what you are doing.
Code:
Code: - <script type="text/JavaScript">
- <!--
- //Graphical Confirm Logout
- //Written by Dranew
-
- //Coninue Image
- var cnt = "URL OF CONTINUE IMAGE";
- cntHeight = "52px";
- cntWidth = "194px";
-
- //Cancel Image
- var can = "URL OF CANCEL IMAGE";
- canHeight = "52px";
- canWidth = "194px";
-
- var gLog = {
- sLog:function() {
- var log = get('menu_buttons','id').getElementsByTagName('a')
- log = log[get('menu_buttons','id').getElementsByTagName('a').length-1]
-
- if(vf_username != 'guest'){
- log.href = 'javascript:gLog.showLog()';
- }
- },
-
- bLog:function() {
- var tbl = '<div id="logOff" style="display:none;">';
- tbl += '<table class="border" align="center" cellpadding="3" cellspacing="1" width="100%">';
- tbl += '<tr><td class="title1" width="100%"><span class="title">Log off</span></td></tr>';
- tbl += '<tr><td class="window1" align="center"><h3>You are now logging off</h3>';
- tbl += '<ul><li><a href="/action/logout"><img src="'+cnt+'" height = "'+cntHeight+'" width="'+cntWidth+'" border="0" /></a></li>';
- tbl += '<li><a href=javascript:gLog.showLog()><img src="'+can+'" height = "'+canHeight+'" width="'+canWidth+'" border="0" /></a></li></ul>';
- tbl += '</tr></table></div>';
- document.write(tbl);
- },
-
- showLog:function() {
- var eLog = get('logOff','id')
- eLog.style.display = (eLog.style.display == "none")? '':'none';
- }
- }
-
- gLog.bLog();
- gLog.sLog();
-
- //-->
- </script>
-
now, to edit:
//Coninue Image var cnt = ""; is the URL of the "continue" Image cntHeight = "52px"; is the Height of the "continue" image cntWidth = "194px"; is the Width of the "continue" image
//Cancel Image var can = ""; is the URL of the "cancel" image canHeight = "52px"; is the Height of the "cancel" image canWidth = "194px"; is the Width of the "cancel" image | |
o_O |
|