多个jquery函数没有';行不通
我一整天都在试图弄明白为什么我的代码不起作用。我在jQuery中有多个函数,当我尝试组合它们时,其中一个将无法工作 这是我现在的全部代码多个jquery函数没有';行不通,jquery,anythingslider,Jquery,Anythingslider,我一整天都在试图弄明白为什么我的代码不起作用。我在jQuery中有多个函数,当我尝试组合它们时,其中一个将无法工作 这是我现在的全部代码 jQuery(document).ready(function($){ jQuery('#slider').anythingSlider({ mode : 'h', // fade mode - new in v1.8! easing
jQuery(document).ready(function($){
jQuery('#slider').anythingSlider({
mode : 'h', // fade mode - new in v1.8!
easing : '<?php echo $data['slideshow_transition']; ?>',
buildArrows : <?php echo $data['slide_arrows']; ?>, // If true, builds the forwards and backwards buttons
buildNavigation : <?php echo $data['slide_anchor']; ?>, // If true, builds a list of anchor links to link to each panel
buildStartStop : <?php echo $data['slide_startstop']; ?>, // If true, builds the start/stop button
toggleArrows : <?php echo $data['slide_toggle_arrows']; ?>, // If true, side navigation arrows will slide out on hovering & hide @ other times
toggleControls : <?php echo $data['slide_toggle_controls']; ?>, // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
startPanel : <?php echo $data['slideshow_start_from']; ?>,
autoPlay : <?php echo $data['slideshow_pause']; ?>, // If true, the slideshow will start running; replaces "startStopped" option
autoPlayLocked : <?php echo $data['slideshow_user_pause']; ?>, // If true, user changing slides will not stop the slideshow
autoPlayDelayed : false, // If true, starting a slideshow will delay advancing slides; if false, the slider will immediately advance to the next slide when slideshow starts
pauseOnHover : <?php echo $data['slideshow_hover_pause']; ?>, // If true & the slideshow is active, the slideshow will pause on hover
stopAtEnd : <?php echo $data['slideshow_endstop']; ?>, // If true & the slideshow is active, the slideshow will stop on the last page. This also stops the rewind effect when infiniteSlides is false.
playRtl : <?php echo $data['slideshow_direction']; ?>, // If true, the slideshow will move right-to-left
resumeOnVideoEnd : true, // If true & the slideshow is active & a supported video is playing, it will pause the autoplay until the video is complete
addWmodeToObject : "opaque",
onSlideBegin: function(e,slider) {
// keep the current navigation tab in view
slider.navWindow( slider.targetPage );
}
});
// Videos on click grid and list style
var animateSpeed = 500;
jQuery("#layout-controls a").click(function(){
var curClass = jQuery('#videos').attr('class');
var newClass = jQuery(this).attr('class');
jQuery('#videos').fadeOut(animateSpeed,function(){
jQuery('#videos').removeClass(curClass,animateSpeed);
jQuery('#videos').addClass(newClass,animateSpeed);
}).fadeIn(animateSpeed);
return false;
});
jQuery("#cw-layout-controls a").click(function(){
var curClass = jQuery('#cw-videos').attr('class');
var newClass = jQuery(this).attr('class');
jQuery('#cw-videos').fadeOut(animateSpeed,function(){
jQuery('#cw-videos').removeClass(curClass,animateSpeed);
jQuery('#cw-videos').addClass(newClass,animateSpeed);
}).fadeIn(animateSpeed);
return false;
});
//Validate contact form
jQuery('#contactform').validate();
//Slow scroll to comments area
var commentTopPosition = jQuery('#comments').offset().top;
// When #comment-scroll is clicked
jQuery('#comment-scroll').click(function(){
// Scroll down to 'commentTopPosition'
jQuery('html, body').animate({scrollTop:commentTopPosition}, 'slow');
// Stop the link from acting like a normal anchor link
return false;
});
jQuery(".vf-table tr:even").addClass("even");
jQuery(".vf-table tr td").css({'border-left': '1px solid <?php $borders ?>', 'border-right': '1px solid <?php $borders ?>'});
jQuery(".vf-table tr th").css({'background': '<?php $borders ?>'});
});
jQuery(文档).ready(函数($){
jQuery(“#slider”).anythingSlider({
模式:“h',//淡入淡出模式-v1.8中新增!
他说:,
buildArrows:,//如果为true,则生成向前和向后按钮
buildNavigation:,//如果为true,则生成指向每个面板的锚链接列表
buildStartStop:,//如果为true,则生成开始/停止按钮
toggleArrows:,//如果为true,则侧导航箭头将在悬停时滑出并隐藏@其他时间
toggleControls:,//如果为true,则在悬停和滑动时滑入控件(导航+播放/停止按钮)更改,隐藏@其他时间
startPanel:,
自动播放:,//如果为true,幻灯片将开始运行;替换“startStopped”选项
autoPlayLocked:,//如果为true,用户更改幻灯片将不会停止幻灯片放映
autoPlayDelayed:false,//如果为true,则开始幻灯片放映将延迟前进幻灯片;如果为false,则在幻灯片放映开始时,滑块将立即前进到下一张幻灯片
pauseOnHover:,//如果为true&幻灯片放映处于活动状态,则幻灯片放映将在悬停时暂停
stopAtEnd:,//如果为true&幻灯片放映处于活动状态,则幻灯片放映将在最后一页停止。当infiniteSlides为false时,这也会停止回放效果。
playRtl:,//如果为true,幻灯片将从右向左移动
resumeOnVideoEnd:true,//如果为true&幻灯片放映处于活动状态且正在播放受支持的视频,它将暂停自动播放,直到视频完成
addWmodeToObject:“不透明”,
onSlideBegin:功能(e、滑块){
//保持当前导航选项卡处于视图中
slider.navWindow(slider.targetPage);
}
});
//单击网格和列表样式上的视频
var animateSpeed=500;
jQuery(“#布局控件a”)。单击(函数(){
var curClass=jQuery('#videos').attr('class');
var newClass=jQuery(this.attr('class');
jQuery(“#视频”).fadeOut(animateSpeed,function(){
jQuery(“#视频”).removeClass(curClass,animateSpeed);
jQuery(“#videos”).addClass(newClass,animateSpeed);
}).fadeIn(animateSpeed);
返回false;
});
jQuery(“#cw布局控件a”)。单击(函数(){
var curClass=jQuery('#cw videos').attr('class');
var newClass=jQuery(this.attr('class');
jQuery(“#cw视频”).fadeOut(animateSpeed,function(){
jQuery(“#cw videos”).removeClass(curClass,animateSpeed);
jQuery(“#cw videos”).addClass(newClass,animateSpeed);
}).fadeIn(animateSpeed);
返回false;
});
//验证联系人表单
jQuery(“#contactform”).validate();
//缓慢滚动至评论区
var commentTopPosition=jQuery('#comments').offset().top;
//单击#注释滚动时
jQuery(“#注释滚动”)。单击(函数(){
//向下滚动至“commentTopPosition”
jQuery('html,body')。动画({scrollTop:commentTopPosition},'slow');
//停止链接,使其不再像正常的锚链接那样工作
返回false;
});
jQuery(“.vf表tr:偶数”).addClass(“偶数”);
jQuery(“.vf table tr td”).css({'border-left':'1px solid','border-right':'1px solid'});
jQuery(“.vf table tr th”).css({'background':'''});
});
代码的开头是我在最新主题上使用的anythingslider,代码的末尾是jquery代码,用于将css样式添加到主题中的表中
用于更改我以前在不同主题和不同js文件中使用的表样式的代码。但由于某种原因,它在这一个里不起作用。当我使表格边框工作时,滑块不工作,如果我使滑块工作,其他代码不工作
我试图为每个代码分别创建.js文件,并将其包含在主题中,我试图包含php文件中的代码,我试图将代码直接包含在标题中,我试图添加jquery,没有冲突,我尝试$而不是jquery,但都不起作用。从这里我看不到我的代码中有任何错误。能不能请更聪明的人解释一下我遗漏了什么,这样我的代码就不能用了。好的,我找到了问题所在 在禁用注释的页面上,没有#comments div,因此此处
var commentTopPosition = jQuery('#comments').offset().top;
jQuery中断
以及它破裂后的一切。我只是对我的注释php文件做了一些细微的更改,现在它可以工作了。有什么原因使您的第一段php代码在字符串中,而其他的不是?代码的第一部分从框架中的字符串中提取值。代码的第二部分从ShortCode中提取值请给出呈现的代码的外观。将此标记为答案,以便在接下来的2天内让其他人的生活更轻松。当我点击将其标记为答案时,它说我可以在2天后接受我自己的答案。