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 10 of 10
  1. #1
    New to the CF scene
    Join Date
    May 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with a script i found online

    I found this script on the Web and while it seems to work in i.e. - it doesn't work in navigator - at least not in 7.0. I don't know much about this yet, can someone help me get it to work in navigator.

    Any help anyone might be able to offer would be greatly appreciated.

    Thanks

    Dan


    <!--
    function buildMenu() {
    speed=0;
    topdistance=123;
    items=4;
    y=-50;
    ob=1;
    if (navigator.appName == "Netscape") {
    v=".top=",dS="document.",sD="";
    }
    else {
    v=".pixelTop=",dS="",sD=".style";
    }
    }
    function scrollItems() {
    if (ob<items+1) {
    objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y);
    if (y<topdistance) setTimeout("scrollItems()",speed);
    else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed);
    }
    }
    -->

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just a guess, try it like this
    Code:
    function buildMenu() {
    speed=0;
    topdistance=123;
    items=4;
    y=-50;
    ob=1;
    v=".pixelTop=",dS="",sD=".style";
    }
    
    function scrollItems() {
    if (ob<items+1) {
    objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y);
    if (y<topdistance) setTimeout("scrollItems()",speed);
    else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed);
    }
    }
    A link to the original script would help

  • #3
    New to the CF scene
    Join Date
    May 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    re: navigation script

    Graeme,

    thanks for the quick reply.

    I tried your revised code in i.e. and it works fine; however, it still won't work in navigator 7.0

    I see you took out the navigator if/else statement.

    I cannot recall where i got the script, but I can attach the pages so that you can see how it works in internet explorer.




    P.S. I have another big project I could use some help with. I see you're a CF addict - that's great. I'm just starting out with CFMX and may have bitten off more than I can chew! I have to create a site where the homepage is automatically updated when the admin selects a given radiobutton. Maybe there's a tutorial that you know of that could help me. I've searched high and low for keywords and haven't found any yet.

    But first things first - if you're willing
    Attached Files Attached Files

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Posts
    596
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CF == Coding Forums

    That script has whiskers on it...it's pretty much an old IE4 vs. Navigator script. I'd forget it and look around for others, plenty to choose from.

    Good luck with your CF!

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I agree with cheesebagpipe. Also, I'm looking at home.html now and it's full of syntax errors.

    1 reason the JS isn't working in NN is because it's reffering to element IDs directly. That's an outdated IE only method.

    I corrected the syntax errors I found in the page and I'll see if the JS can easily be modernized.

    <added>
    more syntax errors in the js file. Don't use <!-- in js files
    </added>
    Last edited by Graeme Hackston; 07-01-2003 at 11:09 PM.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, here's home.html and navmenu.js working in Mozilla 1.4
    Code:
    <html>
    <head>
    <style type="text/css">
    <!--
    A:hover{COLOR: #cccccc; 
    FONT-WEIGHT: bolder; 
    text-decoration:none;
    margin-left:20px}
    -->
    </style>
    <script type="text/javascript" src="navmenu.js"></script> 
    
    <style type="text/css">
    #image1{float:center;padding:3px;}
    </style>
    
    
    <link rel="stylesheet" type="text/css" href="master_style_sheet.css">
    <title>dansworth
    </title>
    </head>
    <body bgcolor="#339999">
    <div class="mainpanel">
    <h1>Welcome to dansworth!<br></h1>
    
    <h2><p>We Translate The Mind's Vision - Into Reality</p></h2>
    
    <h3>There's No Project Too Large Or Small For dansworth</h3>
    
    <h3><p>Here at dansworth we commit great resources into a vision of
    simplicity.  We stress this concept in all of our projects and we're proving
    or perhaps improving on the age old adage of "keeping it simple".
    </div>
    <div class="nestedpanel">
    Please send an email if you've seen any of our work on the Internet and we've sparked an
    interest.  Sorry for the inconvenience of our "Work in Progress"site here at U.A.T.</h3>
    <p>Please send your email to  <A HREF="mailto:danacton@uat.edu" TARGET="_top"    TITLE="mailto:danacton@uat.edu"><font color="lime"><U>dansworth</U></A></font></p></h3>
    - or give us a call at:<br/><b> 602-275-2352</b>
    </div>
    
    <div class="banner1">
    <img id="image1" src="images/banner.gif">
    </div>
    <div class="banner2">
    <img id="image1" src="images/banner.gif">
    </div>
    <div class="banner3">
    <img id="image1" src="images/banner.gif">
    </div>
    <div class="banner4">
    <img id="image1" src="images/banner.gif">
    </div>
    <div class="banner5">
    <img id="image1" src="images/banner.gif">
    </div>
    <div class="banner6">
    <img id="image1" src="images/banner.gif">
    </div>
    <div class="banner7">
    <img id="image1" src="images/banner.gif">
    
    <!-- navigation ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
    <div class="navigation" id="object1">
    <table bgColor=#087b7b border=0 width=150 style="font-size:13px;font-style:italic;font-weight:900;text-decoration:none">
    <tbody>    
    <tr>
        <td>
          <center><a href="home.html"><font 
          face="Tahoma"><font color=lime>Home</font></a> 
        </center></td></tr></tbody></table></div>
    
    <div class="navigation" id="object2">
    <table bgColor=#087b7b border=0 width=150 style="font-size:13px;font-style:italic;font-weight:900;text-decoration:none">
    <TBODY>    
    <tr>
        <td>
          <center><a href="services.html"><font
          face="Tahoma"><font color=lime>Services</font></a> 
        </center></td></tr></tbody></table></div>
    
    <div class="navigation" id="object3">
    <table bgColor=#087b7b border=0 width=150 style="font-size:13px;font-style:italic;font-weight:900;text-decoration:none">
    <TBODY>    
    <tr>
        <td>
          <center><a href="aboutus.html"><font
          face="Tahoma"><font color=lime>About Us</font></a> 
        </center></td></tr></tbody></table></div>
    
    
    <div class="navigation" id="object4">
    <table bgColor=#087b7b border=0 width=150 style="font-size:13px;font-style:italic;font-weight:900;text-decoration:none">
    <TBODY>    
    <tr>
        <td>
          <center><a href="contactus.html"><font
          face="Tahoma"><font color=lime>Contact Us</font></a> 
        </center></td></tr></tbody></table></div>
    
    <div class="footer">
    <a href=http://www.uat.edu target=_blank><img src="images/UATBanner005.gif" alt="Hosted by The University of Advancing Technology"></a>
    </div>
    
    </body>
    </html>
    
    
    
    JS file
    
    
    onload = function() {
    for (var i= 0; i<20; i++) {
    if (EL('object' + i)) {
    window['object' + i] = EL('object' + i)
    }
    }
    buildMenu()
    scrollItems()
    }
    
    function buildMenu() {
    speed=0;
    topdistance=123;
    items=4;
    y=-50;
    ob=1;
    v=".top=",dS="document.",sD="";
    v=".top=",dS="",sD=".style";
    }
    
    function scrollItems() {
    if (ob<items+1) {
    objectX="object"+ob
    y+=10
    var function_str = new Function(dS + objectX + sD + v + y)
    function_str()
    if (y<topdistance) setTimeout("scrollItems()",speed);
    else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed)
    }
    }
    
    function EL(el) {
    return document.getElementById(el)
    }
    <edit>
    I noticed I added an array that wasn't needed, I removed it.
    </edit>
    Last edited by Graeme Hackston; 07-02-2003 at 04:13 AM.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have to create a site where the homepage is automatically updated when the admin selects a given radiobutton.
    You'll need to further explain what you want to do. Will this radio button be on or offline?

  • #8
    New to the CF scene
    Join Date
    May 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    radiobutton

    To answer your question as to whether or not the radiobutton would be online:

    I guess that you would say it is online in that it will be able to be accessed from anyone with admin. rights so that content can be entered into the database from anywhere - and the homepage can be updated from anywhere.

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you get the menu working in NN?

    I think you'll have to use server side languages which I don't know.

    Try asking a question in one of these forums.
    http://www.codingforums.com/forumdis...p?s=&forumid=4

  • #10
    New to the CF scene
    Join Date
    May 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Graeme,

    Sorry it's been so long, but yes - thanks for your help in the code for the web page. It works in navigator 7.0 and I cannot thank you enough.

    I didn't think you had replied to my last post - but thanks again.



  •  

    Posting Permissions

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