简体   繁体   中英

How to override Weebly Javascript on flyout menu?

By default, Weebly appears to append a jquery function to it's submenu, to hide the submenu and display it when the user hovers over the parent menu element.

Does anyone know if there is a way to prevent this happening? It's all performed after the configurable html/css/javascript items are loaded with a custom page template.

Weebly at first refused to provide assistance for a custom template issue.

This URL http://www.base.co/

Submenus on the left hand menu are affected by a javascript function to display:none/block when the user hovers on the parent.

I want to make the submenus always display beneath the parent.

Thanks ahead.

=> EDIT

From Weebly Support:

"If you wanted to bypass the scripting that's in place the current Weebly created menu would need to be removed (deleted from the code) and the new menu would need to be manually created in the code. This is the only way to get around the built in scripting."

..which would explain why this guy wanted to do this Auto-Generated Side Menu for Weebly, perhaps with JavaScript or jQuery

Use jQuery to override the 'mouseover' event on menu anchors:

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>

<script>
$(document).ready(function(){
  $("ul.wsite-menu-default a").mouseover(function(){
    //your javascript code here
  });
});
</script>

Or in case you want to override specific menu item:

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>

<script>
$(document).ready(function(){
  $("ul.wsite-menu-default a:contains('Channels')").mouseover(function(){
    //your javascript code here
  });

  $("ul.wsite-menu-default a:contains('About')").mouseover(function(){
    //your javascript code here
  });
});
</script>

Weebly provided the following answer to this question

Hello,

That specific functionality is created using scripting that is largely global scripting that gets applied to the {menu} in the code.

If you wanted to bypass the scripting that's in place the current Weebly created menu would need to be removed (deleted from the code) and the new menu would need to be manually created in the code. This is the only way to get around the built in scripting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM