私は自分のコードが機能しない理由を理解するために一日中努力してきました。jQueryに複数の関数があり、それらを組み合わせようとすると、そのうちの1つが機能しません。
これが今のところ私のコード全体です。
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 ?>'});
});
コードの最初は最新のテーマで使用するanythingsliderで、コードの最後はjqueryコードで、テーマのテーブルにcssスタイルを追加します。
以前にさまざまなテーマやさまざまなjsファイルで使用していたテーブルスタイルを変更するコード。しかし、何らかの理由で、これでは機能しません。テーブルの境界線を作成してanythingsliderを機能させると、anythingsliderを機能させると、他のコードが機能しなくなります。
I was trying to create .js file for every code separately and include it in theme, i was trying to include code from php file, i was trying to include code directly in header i was trying to add jquery no conflict i was trying $ instead of jQuery and none of it works. From this i don't see any errors in my code. Can someone smarter explain me what am i missing so my code is not working in this.