Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: onClick Navig 4

  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Lingle, Wy
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onClick Navig 4

    As usual Navigator 4 !

    It will work outside the <div> tag in Netscape but not when the img is positioned.

    Trying to incorporate onClick inside a <div>. tag.
    Works in explorer.Not in Netscape 4

    Maybe start a new extension called .Not for all this stuff!

    This the code:

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <META name="description" content="">
    <META name="keywords" content="">
    <META name="generator" content="CuteHTML">
    </HEAD>
    <LINK REL="stylesheet" HREF="http://www.proamrodeo.com/scriptlib/overlib.css" TYPE="text/css">

    <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">


    <DIV ID="overDiv" STYLE="position:absolute; visibility:hide; z-index:2;"></DIV>


    <SCRIPT LANGUAGE="JavaScript" SRC="http://www.proamrodeo.com/scriptlib/overlib.js"></SCRIPT>


    <A HREF="javascript:void(0);" onfocus="this.blur()" onClick="src('Text','J.W. Kinder!'); return false;" onMouseOver="drc('Information and Links Available here.','Click to Stick A Description and Links.'); return true;" onMouseOut="nd(); return true;"><img src="http://www.proamrodeo.com/jpg/jwcard.jpg" border="0"></img></A>

    The Above set up works but the below won't support onClick I think?

    Should be able to cut and paste into editor to display in browser.
    (Sorry in advance if I have insulted your intelligence)


    <DIV STYLE="position:absolute; top:240px; left:140px; width:165px; border-width:0; visibility: visible; z-index:1">
    <a href="javascript:void(0);" onfocus="this.blur()" onClick="src('Text','J.W. Kinder!'); return false;" onMouseOver="drc('Information and Links Available here.','Click to Stick A Description and Links.'); return true;" onMouseOut="nd(); return true;">
    <img src="http://www.proamrodeo.com/jpg/jwcard.jpg" border="0"></img></a>
    </DIV>
    <DIV STYLE="position:absolute; top:320px; left:300px; width:165px; border-width:0; visibility: visible; z-index:2">
    <a href="javascript:void(0);" onfocus="this.blur()" onClick="src('Text','J.W. Kinder!'); return false;" onMouseOver="drc('Information and Links Available here.','Click to Stick A Description and Links.'); return true;" onMouseOut="nd(); return true;">
    <img src="http://www.proamrodeo.com/jpg/sportsshot.jpg" border="0"></img></a><BR>
    </DIV>
    <DIV STYLE="position:absolute; top:390px; left:150px; width:165px; border-width:0; visibility: visible; z-index:1">
    <a href="javascript:void(0);" onfocus="this.blur()" onClick="src('Text','J.W. Kinder!'); return false;" onMouseOver="drc('Information and Links Available here.','Click to Stick A Description and Links.'); return true;" onMouseOut="nd(); return true;"><img src="http://www.proamrodeo.com/jpg/replay1.jpg" border="0"></img></a>
    </DIV>



    </DIV>
    </BODY>
    </HTML>
    Last edited by craig; 08-04-2002 at 03:21 AM.
    Thank You.

  • #2
    New to the CF scene
    Join Date
    Aug 2002
    Location
    TN
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Regarding this,

    <A HREF="java script:void(0);" onfocus="this.blur()" onClick="src('Text','J.W. Kinder!'); return false;"

    For the HREF, I think "javascript" should not have a space in it. But it could also be empty because the "return false" will cancel the normal HTML action. So it could just as well be, HREF="". I have used, HREF="javascript:function()", which works on some browsers and not others, so I don't use it at all anymore; I just put the code in the "onclick" with "return false" and set the HREF="".

    About the "onclick="src(...)", is a function you made, right? I didn't see its definition in your listing, maybe it's in the js file. I'm thinking there might be a conflict with a reserved word. Maybe rename that function.

    I'm not sure why it doesn't work but you might try this change,

    <A HREF="" onfocus="this.blur()" onClick="fetch('Text','J.W. Kinder!'); return false;" ....

    I took out the HREF stuff because it isn't going to do anything anyway (because of "return false") and it might be causing an error. And, I renamed the function to "fetch" in case "src" is being perceived as a name-use travisty. Of course, the function name would have to be changed in the js file also.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    i think there's no onclick event for <A> tag in NS4. I've also experienced that. That's why I used href="javascript:" instead
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by glenngv
    i think there's no onclick event for <A> tag in NS4. I've also experienced that. That's why I used href="javascript:" instead
    A tags in NS4 do support the onclick handler. But using javascript: urls is probably easier, because it saves all that messing around with voiding the link href - incidentally void would generate a strict-warning "useless expression". You don't need it all. Simply

    <a href="javascript:src('Text','J.W. Kinder!')" ...

    would work. if not, let's see the udnerlying code that's called by that function


    btw - ignore space between "java" and "script" - it shouldn't have a space - the forum's adding that for some reason


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •