我有一个问题,与响应菜单切换,而不是扩大在一个网站,我正在工作。本质上,当站点被调整到768 it以下时,菜单将被替换为菜单切换,当点击/点击时,它应该显示关于& Shop的两个选项。然而,当点击什么都没有发生时,它只是将#导航添加到URL的末尾。
我已经设法缩小到了index.php文件中用于index.php的一行代码。
<?php if(sb_slides_display()){sb_slides_display();} ?>
它是一个简单的WordPress站点,WooCommerce使用主题神秘感。链接:http://bit.ly/1dvdeb0
如果我取出上面的代码,问题就解决了,但是当然,滑块不再被激活。你知道为什么或者怎样才能修好它吗?
此外,下面是上下文中的代码:
<?php
// File Security Check
if ( ! function_exists( 'wp' ) && ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
die ( 'You do not have sufficient permissions to access this page!' );
}
?><?php
/**
* Index Template
*
* Here we setup all logic and XHTML that is required for the index template, used as both the homepage
* and as a fallback template, if a more appropriate template file doesn't exist for a specific context.
*
* @package WooFramework
* @subpackage Template
*/
get_header();
global $woo_options;
?>
<?php if(sb_slides_display()){sb_slides_display();} ?>
<?php if ( $woo_options[ 'woo_homepage_banner' ] == "true" ) { ?>
<div class="homepage-banner">
<?php
if ( $woo_options[ 'woo_homepage_banner' ] == "true" ) { $banner = $woo_options['woo_homepage_banner_path']; }
if ( $woo_options[ 'woo_homepage_banner' ] == "true" && is_ssl() ) { $banner = preg_replace("/^http:/", "https:", $woo_options['woo_homepage_banner_path']); }
?>
<img src="<?php echo $banner; ?>" alt="" />
<h1><span><?php echo $woo_options['woo_homepage_banner_headline']; ?></span></h1>
<div class="description"><?php echo wpautop($woo_options['woo_homepage_banner_standfirst']); ?></div>
</div>
<?php } ?>
<div id="content" class="col-full <?php if ( $woo_options[ 'woo_homepage_banner' ] == "true" ) echo 'with-banner'; ?> <?php if ( $woo_options[ 'woo_homepage_sidebar' ] == "false" ) echo 'no-sidebar'; ?>">
谢谢您的帮助,非常感谢!:)
编辑:来自控制台错误的JavaScript页面TypeError: Object没有方法'fitVids‘:
/*-----------------------------------------------------------------------------------*/
/* GENERAL SCRIPTS */
/*-----------------------------------------------------------------------------------*/
jQuery(document).ready(function($){
// Fix dropdowns in Android
if ( /Android/i.test( navigator.userAgent ) && jQuery( window ).width() > 769 ) {
$( '.nav li:has(ul)' ).doubleTapToGo();
}
// Table alt row styling
jQuery( '.entry table tr:odd' ).addClass( 'alt-table-row' );
// FitVids - Responsive Videos
jQuery( ".post, .widget, .panel" ).fitVids();
// Add class to parent menu items with JS until WP does this natively
jQuery("ul.sub-menu").parents('li').addClass('parent');
// Responsive Navigation (switch top drop down for select)
jQuery('ul#top-nav').mobileMenu({
switchWidth: 767, //width (in px to switch at)
topOptionText: 'Select a page', //first option text
indentString: ' ' //string for indenting nested items
});
// Show/hide the main navigation
jQuery('.nav-toggle').click(function() {
jQuery('#navigation').slideToggle('fast', function() {
return false;
// Animation complete.
});
});
// Stop the navigation link moving to the anchor (Still need the anchor for semantic markup)
jQuery('.nav-toggle a').click(function(e) {
e.preventDefault();
});
// Add parent class to nav parents
jQuery("ul.sub-menu, ul.children").parents().addClass('parent');
});
发布于 2014-01-30 09:55:08
来自comments above中的霍波
fitvids和mobileMenu都是在第三方in中声明的。在我看来,他们似乎不需要noConflict --我认为这是为了当您想要使用$而不是jQuery时,但是您的代码使用jQuery,所以应该可以。我现在认为问题是jQuery被包括了两次--尝试从Google中删除第二个(v1.8.2 )。它可能(从邻近程度判断)包含了您的slicebox.js。
https://stackoverflow.com/questions/21304067
复制相似问题