javascript mouseover problem

Discussion in 'Javascript' started by tsangkinyip@gmail.com, Mar 10, 2007.

  1. Guest

    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>
    , Mar 10, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVs?=
    Replies:
    3
    Views:
    1,239
    =?Utf-8?B?U3JlZWppdGggUmFt?=
    Aug 10, 2005
  2. Tony
    Replies:
    3
    Views:
    88,280
    Richard
    Jan 17, 2004
  3. John J

    javascript mouseover

    John J, Apr 10, 2004, in forum: Javascript
    Replies:
    2
    Views:
    139
    John J
    Apr 10, 2004
  4. richk

    Javascript Mouseover Problem

    richk, May 27, 2004, in forum: Javascript
    Replies:
    3
    Views:
    83
    Thomas 'PointedEars' Lahn
    May 29, 2004
  5. javascript mouseover problem

    , Mar 10, 2007, in forum: Javascript
    Replies:
    0
    Views:
    168
Loading...

Share This Page