最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - WordPress Menuing Question :focus

programmeradmin2浏览0评论

I'm using the following script in the WordPress functions.php file to disable top level parent items when they have a submenu. It works perfectly, but I need to it actually work like this:

If someone is using a mouse and clicks on the link - go ahead and load the parent link If someone is using a keyboard and tabbing through - if they enter on the parent link - don't load it

Right now, it's blocking the link on the both. Any help would be appreciated.

function jqueryscript_in_head(){ ?>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function () {
$j("li:has(ul)").children("a").click(function () {
return false;
});  });
</script>
<?php }
add_action('wp_head', 'jqueryscript_in_head');
发布评论

评论列表(0)

  1. 暂无评论