Automatic Slider Help...
Automatic Slider Help...
I have a
http://epic4life.com that I am trying to edit. The theme has a built in slider using jquery, but I'm not good enough to know how to edit it. What I'm trying to do is make the slider move automatically every 5 seconds, but pause if it's moused over and then restart after the mouseout. The author of the theme says that he can't help me. Please help!
I have tried several things but only end up messing it up...
-
jQuery.noConflict();
function kriesi_mainmenu(){
if(!jQuery.browser.msie){// IE - 2nd level Fix
jQuery(" #nav ul ").css({opacity:"0.95"});
}
jQuery("#nav a").removeAttr('title');
jQuery(" #nav ul ").css({display: "none"}); // Opera Fix
jQuery(" #nav > li > ul").parent().find("a:first").append("<span class='sub_list'> </span>");
jQuery(" #nav ul li > ul").parent().find("a:first").append("<span class='sub_sub_list'> </span>");
jQuery(" #nav li").hover(function(){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
},function(){
jQuery(this).find('ul:first').css({visibility: "hidden"});
});
}
function kriesi_noscript(){
$content =jQuery(".widget_rss h3 a:eq(1)").html();
jQuery(".widget_rss h3 a").remove();
jQuery(".widget_rss h3").append($content);
jQuery(".jshide").css({visibility:"visible"});
if(jQuery(".next").length > 1){
jQuery(".next").css({visibility:"visible"});
}
}
function my_smothscroll(){
jQuery('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
var $target = jQuery(this.hash);
$target = $target.length && $target
|| jQuery('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
jQuery('html,body')
.animate({scrollTop: targetOffset}, 700);
return false;
}
}
});
}
function kriesi_sleekslide(){
modifyIE = 1;
if(jQuery.browser.msie && jQuery.browser.version < 7){// IE6 Fix
modifyIE = -1;
}
var animation_stopped = true;
var viewport = (jQuery(window).width() * 2);
jQuery(".slider_container:not(.slide1)").each(function(i){
var currentPos_container = jQuery(this).position();
var newpos_container = (currentPos_container.left + viewport) * modifyIE;
jQuery(this).css({left:newpos_container}).removeClass("notactive");
});
jQuery(".buttonlinks .next").each(function(i){
jQuery(this).bind("click",function(){
if(animation_stopped){
animation_stopped = false;
viewport = (jQuery(window).width() * 2);
var number = i +1;
var next = i + 2;
if(jQuery(".slider_container").length < next){
next = 1;
}
jQuery('.slide'+ number).animate({left:-viewport},600,"easeInQuint",function(){
var css_set = viewport * modifyIE;
jQuery('.slide'+ number).css({left:css_set});
jQuery('.slide'+ next).animate({left:0},600,"easeOutBack");
animation_stopped = true;
});
jQuery('.slide'+ number+ ' .slideme').each(function(i){
var speed = 450;
var this_css_left = jQuery(this).css("left");
var pos_left = parseInt(this_css_left.replace(/px/g, ""));
var adjust_left = pos_left + ((i+1) * 35);
jQuery(this).animate({left:adjust_left},speed,"linear").animate({left:pos_left},300);
;
});
}
return false;
});
});
}
function form_validation(){
jQuery(".empty, .email").each(function(i){
jQuery(this).bind("blur", function(){
var value = jQuery(this).attr("value");
var check_for = jQuery(this).attr("class");
var surrounding_element = jQuery(this).parent("p");
var template_url = jQuery("meta[name=Sleek_option1]").attr('content');
jQuery.ajax({
type: "POST",
url: template_url + "/validate.php",
data: "value="+value+"&check_for="+check_for,
beforeSend:function(){
surrounding_element.attr("class","").addClass("ajax_loading");
},
error:function(){
surrounding_element.attr("class","").addClass("ajax_alert");
},
success: function(response){
if(response == "true"){
surrounding_element.attr("class","").addClass("ajax_valid");
}else{
surrounding_element.attr("class","").addClass("ajax_false");
}
}
});
});
});
}
function validate_all(){
var my_error;
jQuery(".ajax_form #send").bind("click", function(){
my_error = false;
jQuery(".empty, .email").each(function(i){
var value = jQuery(this).attr("value");
var check_for = jQuery(this).attr("class");
var surrounding_element = jQuery(this).parent("p");
var template_url = jQuery("meta[name=Sleek_option1]").attr('content');
jQuery.ajax({
type: "POST",
url: template_url + "/validate.php",
data: "value="+value+"&check_for="+check_for,
beforeSend:function(){
surrounding_element.attr("class","").addClass("ajax_loading");
},
error:function(){
surrounding_element.attr("class","").addClass("ajax_alert");
},
success: function(response){
if(response == "true"){
surrounding_element.attr("class","").addClass("ajax_valid");
}else{
surrounding_element.attr("class","").addClass("ajax_false");
my_error = true;
}
if(jQuery(".empty, .email").length == i+1){
if(my_error == false){
jQuery("#ajax_form").slideUp(400);
var yourname = jQuery("#name").attr('value');
var email = jQuery("#email").attr('value');
var website = jQuery("#website").attr('value');
var message = jQuery("#message").attr('value');
var myemail = jQuery("#myemail").attr('value');
var myblogname = jQuery("#myblogname").attr('value');
jQuery.ajax({
type: "POST",
url: template_url + "/send.php",
data: "Send=true&yourname="+yourname+"&email="+email+"&website="+website+"&message="+message+"&myemail="+myemail+"&myblogname="+myblogname,
success: function(response){
jQuery("#ajax_response").css({display:"none"}).html(response).slideDown(400);
}
});
}
}
}
});
});
return false;
});
}
jQuery(document).ready(function(){
my_smothscroll();
kriesi_sleekslide();
kriesi_mainmenu();
kriesi_noscript();
form_validation();
validate_all();
});