Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #595434

    Hello,

    I would like to add a button and image link to the sub-menu on my home page. I would like this to add when the sub-menu switches to sticky when the user scrolls down. I think I have it worked out to add these elements in jQuery, but I can’t figure out how to link it to so the script is passed at the same time as the menu switching to fixed position.

    Could you help me with this?

    Thanks!

    #597301

    Hi,

    Try opening js/avia.js and look for

    					if(scrolled + modifier > top_pos)
    					{
    						if(!fixed)
    						{
    							this.css({top: modifier - bordermod, position: 'fixed'}); fixed = true
    						}
    					}
    					else
    					{
    						this.css({top: 'auto', position: 'absolute'}); fixed = false
    					}

    Change it to:

    					if(scrolled + modifier > top_pos)
    					{
    						if(!fixed)
    						{
    							this.css({top: modifier - bordermod, position: 'fixed'}).addClass('menu-fixed'); fixed = true
    						}
    					}
    					else
    					{
    						this.css({top: 'auto', position: 'absolute'}).removeClass('menu-fixed'); fixed = false
    					}

    That should toggle a class of menu-fixed to the submenu container, with that you can modify the appearance of a specific menu item with CSS:

    .menu-fixed .custom-menu-item{
    display: block;
    }
    

    Regards,
    Josue

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.