Results 1 to 7 of 7

Thread: Scrollable Menu Links

  1. #1
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Scrollable Menu Links

    hei, first of all sry for my bad english.

    my probl: I want to use same script on same page. the problem is that only the last box displays the menucontents
    can someone help me?
    tx

    p.s.: [I use and php on my page]

    exemple:
    Code:
    <?
    $matrice=array('meniu1', 'meniu2' .... 'meniu15');
    foreach ($matrice as $name){
    ?>
    <script type="text/javascript">
    
    /***********************************************
    * Scrollable Menu Links- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    //configure path for left and right arrows
    var goleftimage<? echo $name;?>='images/left.jpg'
    //
    var gorightimage<? echo $name;?>='images/right.jpg'
    //configure menu width (in px):
    var menuwidth<? echo $name;?>=300
    //configure menu height (in px):
    var menuheight<? echo $name;?>=25
    //Specify scroll buttons directions ("normal" or "reverse"):
    var scrolldir<? echo $name;?>="normal"
    //configure scroll speed (1-10), where larger is faster
    var scrollspeed<? echo $name;?>=6
    //specify menu content
    var menucontents<? echo $name;?>='<? echo $ceva;?>'
    // $ceva is diferit for ecah $name [php part is ok]
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    var iedom<? echo $name;?>=document.all||document.getElementById
    //
    var leftdircode<? echo $name;?>='onMouseover="moveright<? echo $name;?>()" onMouseout="clearTimeout(righttime<? echo $name;?>)"'
    //
    var rightdircode<? echo $name;?>='onMouseover="moveleft<? echo $name;?>()" onMouseout="clearTimeout(lefttime<? echo $name;?>)"'
    //
    if (scrolldir<? echo $name;?>=="reverse"){
    //
    var tempswap<? echo $name;?>=leftdircode<? echo $name;?>
    //
    leftdircode<? echo $name;?>=rightdircode<? echo $name;?>
    //
    rightdircode<? echo $name;?>=tempswap<? echo $name;?>
    //
    }
    //
    
    //
    if (iedom<? echo $name;?>)
    //
    document.write('<span id="temp<? echo $name;?>" style="visibility:hidden;position:absolute;width:10px;">'+menucontents<? echo $name;?>+'</span>')
    //
    var actualwidth<? echo $name;?>=''
    //
    var cross_scroll<? echo $name;?>
    //
    var ns_scroll
    //
    var loadedyes<? echo $name;?>=0
    //
    function fillup<? echo $name;?>(){
    //
    if (iedom<? echo $name;?>){
    //
    cross_scroll<? echo $name;?>=document.getElementById? document.getElementById("test2<? echo $name;?>") : document.all.test2<? echo $name;?>
    //
    cross_scroll<? echo $name;?>.innerHTML='<nobr>'+menucontents<? echo $name;?>+'</nobr>'
    //
    actualwidth<? echo $name;?>=document.all? cross_scroll<? echo $name;?>.offsetWidth : document.getElementById("temp<? echo $name;?>").offsetWidth
    //
    }
    //
    else if (document.layers){
    //
    ns_scroll=document.ns_scrollmenu<? echo $name;?>.document.ns_scrollmenu2<? echo $name;?>
    //
    ns_scroll.document.write(menucontents<? echo $name;?>)
    //
    ns_scroll.document.close()
    //
    actualwidth<? echo $name;?>=ns_scroll.document.width
    //
    }
    //
    loadedyes<? echo $name;?>=1
    //
    }
    //
    window.onload=fillup<? echo $name;?>
    //
    
    function moveleft<? echo $name;?>(){
    //
    if (loadedyes<? echo $name;?>){
    //
    if (iedom<? echo $name;?>&&parseInt(cross_scroll<? echo $name;?>.style.left)>(menuwidth<? echo $name;?>-actualwidth<? echo $name;?>)){
    //
    cross_scroll<? echo $name;?>.style.left=parseInt(cross_scroll<? echo $name;?>.style.left)-scrollspeed<? echo $name;?>+"px"
    //
    }
    //
    else if (document.layers&&ns_scroll.left>(menuwidth<? echo $name;?>-actualwidth<? echo $name;?>))
    //
    ns_scroll.left-=scrollspeed<? echo $name;?>
    //
    }
    //
    lefttime<? echo $name;?>=setTimeout("moveleft<? echo $name;?>()",50)
    //
    }
    //
    
    function moveright<? echo $name;?>(){
    //
    if (loadedyes<? echo $name;?>){
    //
    if (iedom<? echo $name;?>&&parseInt(cross_scroll<? echo $name;?>.style.left)<0)
    //
    cross_scroll<? echo $name;?>.style.left=parseInt(cross_scroll<? echo $name;?>.style.left)+scrollspeed<? echo $name;?>+"px"
    //
    else if (document.layers&&ns_scroll.left<0)
    //
    ns_scroll.left+=scrollspeed<? echo $name;?>
    //
    }
    //
    righttime<? echo $name;?>=setTimeout("moveright<? echo $name;?>()",50)
    //
    }
    //
    
    
    if (iedom<? echo $name;?>||document.layers){
    //
    with (document){
    //
    write('<table border="1" cellspacing="0" cellpadding="2">')
    //
    write('<td valign="middle"><a href="#" '+leftdircode<? echo $name;?>+'><img src="'+goleftimage<? echo $name;?>+'"border=0></a> </td>')
    //
    write('<td width="'+menuwidth<? echo $name;?>+'px" valign="top">')
    //
    if (iedom<? echo $name;?>){
    //
    write('<div style="position:relative;width:'+menuwidth<? echo $name;?>+'px;height:'+menuheight<? echo $name;?>+'px;overflow:hidden;">')
    //
    write('<div id="test2<? echo $name;?>" style="position:absolute;left:0;top:0">')
    //
    write('</div></div>')
    //
    }
    //
    else if (document.layers){
    //
    write('<ilayer width='+menuwidth<? echo $name;?>+' height='+menuheight<? echo $name;?>+' name="ns_scrollmenu<? echo $name;?>">')
    //
    write('<layer name="ns_scrollmenu2<? echo $name;?>" left=0 top=0></layer></ilayer>')
    //
    }
    //
    write('</td>')
    //
    write('<td valign="middle"> <a href="#" '+rightdircode<? echo $name;?>+'>')
    //
    write('<img src="'+gorightimage<? echo $name;?>+'"border=0></a>')
    //
    write('</td></table>')
    //
    }
    //
    }
    
    //
    </script>
    <?
    }
    ?>
    Last edited by radu706; 11-02-2008 at 01:02 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  3. #3
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    http://www.dynamicdrive.com/dynamici...rollerlink.htm


    my page is not online yet. I will put it on when is done.

    wath I want to do is to repeat this menu for each value of array
    Last edited by radu706; 11-04-2008 at 04:16 AM.

  4. #4
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can enyone help me?

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You'll need to clarify the below:

    wath I want to do is to repeat this menu for each value of array
    Are you basically asking how to have more than 1 instance of "Scrollable Menu Links" on your page?
    DD Admin

  6. #6
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes and to work to

  7. #7
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    here is a link

Bookmarks

Posting Permissions

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