Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > javascript mouseover problem

Reply
Thread Tools

javascript mouseover problem

 
 
tsangkinyip@gmail.com
Guest
Posts: n/a
 
      03-10-2007
hi,

i'm working on the following scripts My idea is whenever there's a
mouseover event on the series of links in one frame, the other frame
named "bookmarks" will load new content dynamically. however, when i
put the scripts into practice, some strange behavior happened. the
first time the mouse moved over "culture", it shows the related
bookmarks; but when the mouse moved on the another link eg.
"dictionary", i needed to move over it twice in order for the
"bookmarks" frame to refresh, & vice versa. can anybody help me how to
troubleshoot?

testing.js >>>>>
ie4_or_nn4 = (((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) >= 4 ))
|| ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4 )))
nn3 = ((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) == 3 ))

var activepage = ""

function showPage( bookmark ) {
if ( ie4_or_nn4 || nn3 ) {
if (activepage != bookmark) {
parent.bookmarks.location.href = 'bookmarks-main.html';
parent.bookmarks.showBookmark (bookmark);
activepage = bookmark;
}
}
}

function showBookmark( bookmark ) {
document.open();
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/
general.css\">");
if (bookmark == "culture") {
document.write("<a href=\"http://www.soundportraits.org/\" target=
\"_blank\">Sound Portraits</a>");
}
else if (bookmark == "dictionary") {
document.write("<a href=\"http://dictionary.cambridge.org/\" target=
\"_blank\">Cambridge Online Dictionary</a>");
}
document.close();
}

categories.html (the frame that triggers the refresh on "bookmarks"
frame) >>>>>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>: : : M A R C O : B O O K M A R K S : : :</title>
<link rel="stylesheet" type="text/css" href="css/general.css">
<SCRIPT src="js/testing.js" type=text/javascript></SCRIPT>
</head>
<body>
<a class=locallink href="javascript:void(0);"
onMouseOver="showPage('culture')" style="line-height:2; padding-left:
1em; cursor:hand; color: #999999">culture</a><br>
<a class=locallink href="javascript:void(0);"
onMouseOver="showPage('dictionary')" style="line-height:2; padding-
left: 1em; cursor:hand; color: #999999">dictionary</a><br>
</body>
</html>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript mouseover problem tsangkinyip@gmail.com Javascript 0 03-10-2007 03:32 PM
how to add mouseover event to link button by using javascript? =?Utf-8?B?RGFuaWVs?= ASP .Net 3 08-10-2005 05:45 PM
Javascript Mouseover Problem richk Javascript 3 05-29-2004 01:21 PM
javascript mouseover John J Javascript 2 04-10-2004 09:45 PM
Javascript mouseover text bubble? Tony HTML 3 01-17-2004 04:01 AM



Advertisments