/    Sign up×
Community /Pin to ProfileBookmark

Need div + hotkey help

hi all, i would like to ask for help on div/layer for my webpage.
this is my code

[CODE]
<html>

<HEAD><TITLE>Handling Keyboard Shortcuts in JavaScript</TITLE>

<script language=”JavaScript1.2″>

if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e){
var targeturl=”digital-alarm-clock(edit).swf”
if (document.layers||document.getElementById&&!document.all){
if (e.which==104||e.which==72)
window.location=targeturl
}
else if (document.all){
if (event.keyCode==104||event.keyCode==72)
window.location=targeturl
}
}
document.onkeypress=backhome
//–>
</script>

</head>
<body>
dd
</body>
</html>
[/CODE]

however from this code , the way the alarm is displayed is not what we wnated,after H key is press,the alarm will come out over-lapping the orginal webpage, but what we wanted is to let it silde in horizontally using a div/layer method in the same html page.

would hope there there is any kind soul who can help me with this troublesome code T_T

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@infinityspiralApr 02.2009 — You could assign some CSS to a targeted div holding the alarm. You just have to set it's z-index higher than the page below it and it will move independently.
×

Success!

Help @missyanyan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...