Monday, September 28, 2009

[jQuery] Re: lavalamp category problem

There is a common template, but I'm not sure if the class "category"
is addressed correctly in there. Would there normally be a
correspondence between the classes in the template and the classes in
lavahelper? Sorry if this is a dumb question.

On Sep 26, 12:00 pm, Charlie <charlie...@gmail.com> wrote:
> is there a common php page template for the pages in question that is different from pages that do work? the classes for the lavahelper in the js don't seem to exist so first thought is the template php may not be adding them
> ksprague wrote:on this site:http://www.nrm.org/wordpress/when I go to a category view like thishttp://www.nrm.org/wordpress/category/current-exhibitions/the nicelavalampfeatures fall apart. I have dug into the .js on this but can't figure it out.here is the .js:jQuery.noConflict(); function kriesi_mainmenu(){jQuery("#nav a, #subnav a").removeAttr('title');jQuery(" #nav ul ").css({display: "none"}); // Opera FixjQuery(" #nav li").hover(function(){jQuery(this).find('ul:first:hidden').css({visibility: "visible",display: "none"}).show(400); },function(){jQuery(this).find('ul:first').css({visibility: "hidden"}); }); } ///This functions checks on which subpage you are and applies the background to the main menu function lavahelper() {jQuery("#nav .current_page_item, #nav .current_page_parent, #nav .current_page_ancestor").addClass('current').removeClass ("current_page_item").removeClass("current_page_parent").removeClass ("current_page_ancestor"); } 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=Cube_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=Cube_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(){ kriesi_mainmenu(); lavahelper();jQuery("#nav").lavaLamp({ fx: "easeOutCubic", speed: 700 }); form_validation(); validate_all(); });jQuery(window).load(function(){ // starts executing after all images have loaded to ensure best performancejQuery("#transition-container").toolani_transition({block_size: 80,display_for:6000}); //dont set lower then 6000 or it will produce errors }); /** *LavaLamp- A menu plugin forjQuerywith cool hover effects. * @requiresjQueryv1.1.3.1 or above * *http://gmarwaha.com/blog/?p=7* * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) * Dual licensed under the MIT and GPL licenses: *http://www.opensource.org/licenses/mit-license.php*http://www.gnu.org/licenses/gpl.html* * Version: 0.2.0 * RequiresJquery1.2.1 from version 0.2.0 onwards. * Forjquery1.1.x, use version 0.1.0 oflavalamp*/ (function(jQuery) {jQuery.fn.lavaLamp= function(o) { o =jQuery.extend({ fx: "linear", speed: 500, click: function() {} }, o || {}); return this.each(function() { var me =jQuery(this), noop = function(){}, jQueryback =jQuery('<li class="back"><div class="left"></ div></li>').appendTo(me), jQueryli =jQuery("li", this), curr =jQuery("li.current", this)[0] || false; if (curr == false){jQuery(".back").remove();return false;} jQueryli.not(".back").not("#nav ul li").hover(function() { move(this); }, noop);jQuery(this).hover(noop, function() { move(curr); }); jQueryli.click(function(e) { setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(curr); function setCurr(el) { jQueryback.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" }); curr = el; }; function move(el) { jQueryback.each(function() {jQuery(this).dequeue(); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); }; }); }; })(jQuery); /* *jQueryEasing v1.3 -http://gsgd.co.uk/sandbox/jquery/easing/* * Uses the built in easing capabilities added InjQuery1.1 * to offer multiple easing options * * TERMS OF USE -jQueryEasing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/ or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: durationjQuery.easing['jswing'] =jQuery.easing['swing'];jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); returnjQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart:...
>
> read more »

No comments: