Results 1 to 5 of 5

Thread: Omni slide menu - add small icons?

  1. #1
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Omni slide menu - add small icons?

    Omni Slide Menu script - © John Davenport Scheuer
    http://www.dynamicdrive.com/dynamici...lide/index.htm

    Is it possible to add a gif icon next to each line of the submenu? For example a facebook icon next to the link for facebook. Nothing crazy, just a 25x25 icon. could someone offer a helping hand, im new to this site. These would be the the vertical menu, or menu#2 in the default ocde.

  2. #2
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    This code is a bit over my head but it would seem to have something to do with adding the img ref to this line in the mmenu.js file:


    tb+='<td '+(i_tem==o.menuItems.length-1&&!o.wrapbar&&o.menupos!='top'? 'id="'+o.id+'lastrow" ' : '')+'colspan="'+(o.menuItems[i_tem][3]&&o.menuItems[i_tem][3]!==''? o.menuItems[i_tem][3] : o.d_colspan)+'"><a href="'+o.menuItems[i_tem][1]+'" target="'+(o.menuItems[i_tem][2]? o.menuItems[i_tem][2] : o.linktarget)+'">'+o.menuItems[i_tem][0]+'</a></td>'

    maybe its not that simple...can anyone lend a helping hand?

  3. #3
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    gonna try to bump this one more time as it's been a week. sorry.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That file isn't meant to be edited and hopefully doesn't have to be for your purposes.

    In the menuItems.js file you can put the text you want to appear for each link and heading. I'd try putting an image tag in there. Or using css to add a background image.

    For example, for menu[1] in the demo file it has:

    Code:
    menuItems:[ // REQUIRED!!
    //[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
    ["Menu"], //create header
    ["Dynamic Drive", "http://www.dynamicdrive.com", ""],
    ["What's New", "http://www.dynamicdrive.com/new.htm",""],
    ["What's Hot", "http://www.dynamicdrive.com/hot.htm", ""],
    ["Message Forum", "http://www.dynamicdrive.com/forums", ""],
    ["Submit Script", "http://www.dynamicdrive.com/submitscript.htm", ""],
    ["Link to Us", "http://www.dynamicdrive.com/link.htm", ""],
    Try adding:

    Code:
    menuItems:[ // REQUIRED!!
    //[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
    ["Menu"], //create header
    ["<img src='some.gif' alt=''>Dynamic Drive", "http://www.dynamicdrive.com", ""],
    ["What's New", "http://www.dynamicdrive.com/new.htm",""],
    ["What's Hot", "http://www.dynamicdrive.com/hot.htm", ""],
    ["Message Forum", "http://www.dynamicdrive.com/forums", ""],
    ["Submit Script", "http://www.dynamicdrive.com/submitscript.htm", ""],
    ["Link to Us", "http://www.dynamicdrive.com/link.htm", ""],
    Notice the use of single quotes for the image tag's attributes. I'm not sure if it will work, but it's worth a try.

    Or using css, it's noted on the demo page that the links all have style hooks for any given menu. For menu[1], it's (from the source code for demo.htm):

    Code:
    #menu1 a {color:black;background-color:white;text-decoration:none;text-indent:1ex;}
    #menu1 a:active {color:black;text-decoration:none;}
    #menu1 a:hover {color:black;background-color:#FFFF99}
    #menu1 a:visited {color:black;text-decoration:none;}
    You could do like:

    Code:
    #menu1 a {color:black;background:white url(some.gif) center left no-repeat;text-decoration:none;text-indent:1ex;}
    #menu1 a:active {color:black;text-decoration:none;}
    #menu1 a:hover {color:black;background-color:#FFFF99}
    #menu1 a:visited {color:black;text-decoration:none;}
    There's also a method for using your own markup and/or styles. If all else fails, that may be employed. See:

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

    and use the design_mode: set to true to get the markup and css generated by the menu. You can then copy it and edit it as you please and then put it on your page. Set design_mode to false and set user_defined_markup: and/or user_defined_stylesheet: to true to use your markup and/or styles instead of the script's self generated ones.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    Last edited by jscheuer1; 04-18-2012 at 03:28 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sark76 (04-18-2012)

  6. #5
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up

    Quote Originally Posted by jscheuer1 View Post
    That file isn't meant to be edited and hopefully doesn't have to be for your purposes.

    In the menuItems.js file you can put the text you want to appear for each link and heading. I'd try putting an image tag in there. Or using css to add a background image.

    For example, for menu[1] in the demo file it has:

    Code:
    menuItems:[ // REQUIRED!!
    //[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
    ["Menu"], //create header
    ["Dynamic Drive", "http://www.dynamicdrive.com", ""],
    ["What's New", "http://www.dynamicdrive.com/new.htm",""],
    ["What's Hot", "http://www.dynamicdrive.com/hot.htm", ""],
    ["Message Forum", "http://www.dynamicdrive.com/forums", ""],
    ["Submit Script", "http://www.dynamicdrive.com/submitscript.htm", ""],
    ["Link to Us", "http://www.dynamicdrive.com/link.htm", ""],
    Try adding:

    Code:
    menuItems:[ // REQUIRED!!
    //[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
    ["Menu"], //create header
    ["<img src='some.gif' alt=''>Dynamic Drive", "http://www.dynamicdrive.com", ""],
    ["What's New", "http://www.dynamicdrive.com/new.htm",""],
    ["What's Hot", "http://www.dynamicdrive.com/hot.htm", ""],
    ["Message Forum", "http://www.dynamicdrive.com/forums", ""],
    ["Submit Script", "http://www.dynamicdrive.com/submitscript.htm", ""],
    ["Link to Us", "http://www.dynamicdrive.com/link.htm", ""],
    Notice the use of single quotes for the image tag's attributes. I'm not sure if it will work, but it's worth a try.

    Or using css, it's noted on the demo page that the links all have style hooks for any given menu. For menu[1], it's (from the source code for demo.htm):

    Code:
    #menu1 a {color:black;background-color:white;text-decoration:none;text-indent:1ex;}
    #menu1 a:active {color:black;text-decoration:none;}
    #menu1 a:hover {color:black;background-color:#FFFF99}
    #menu1 a:visited {color:black;text-decoration:none;}
    You could do like:

    Code:
    #menu1 a {color:black;background:white url(some.gif) center left no-repeat;text-decoration:none;text-indent:1ex;}
    #menu1 a:active {color:black;text-decoration:none;}
    #menu1 a:hover {color:black;background-color:#FFFF99}
    #menu1 a:visited {color:black;text-decoration:none;}
    There's also a method for using your own markup and/or styles. If all else fails, that may be employed. See:

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

    and use the design_mode: set to true to get the markup and css generated by the menu. You can then copy it and edit it as you please and then put it on your page. Set design_mode to false and set user_defined_markup: and/or user_defined_stylesheet: to true to use your markup and/or styles instead of the script's self generated ones.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    Awesome! Putting the image tag in worked perfectly! I never thought to try that. Didn't have to go the CSS route...thanks so much for the help jscheuer.

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
  •