JavaScript - Jquery No Conflict Trouble
I currently have to run jQuery.noConflict(); so my other scripts work correctly, examples:
Code: prototype.js validation.js And i have this Code: $( document ).ready( function() { $( window ).scroll( function( e ) { if( $( window ).scrollTop() > 160 ) { $( '.navigation' ).addClass( 'fixed' ); } else { $( '.navigation' ).removeClass( 'fixed' ); } } ); } ); witch works when i take jQuery.noConflict(); out, but with it in it dont work and thats my main feature is there anyway round it, thanks. Similar Tutorialshi guys! i was building a website using two jquery codes . first one for the slideshow banner and the other one for the menu but only one of them works, i've search on the web and i fouond something called jquery no conflict() is this good? this is the code inside de <head> tags Code: <!-- JavaScripts--> <script type="text/javascript"> jQuery.noConflict(); </script> /*This is the menu's*/ <script type='text/javascript' src="jquery-1.2.6.min.js"></script> <script type='text/javascript' src="kwicks.js"></script> <script type='text/javascript' src="custom.js"></script> /*Here starts the sideshow*/ <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/s3Slider.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#slider').s3Slider({ timeOut: 3000 }); }); </script> </head> Hi All, I am simply trying to get 2 booking systems working on the 1 page but it seems that they have a conflict, they both access the exact sames files but whatever one is at the top get priority and works and the 2nd one below doesn't. See he http://www.albergodelsenato.it/test2.php How can I fix this? Please help ASAP. Thanks The following code is needed for the prettyphoto javascript popup. It works fine in Firefox and Safari, but not in any version of IE. Can anyone suggest why? <script> jQuery.noConflict(); $(document).ready(function(){ jQuery("a[rel^='prettyPhoto']").prettyPhoto(); }); </script> I have read that if i have to use jquery with other libraries then i have to use jquery in no conflict mode. I understand that and and it works. i use Code: $j = jquery.noconflict() so that $ of jquery does not mix with $ of other libraries Now my question is that i use any jquery plugin , and i include that JS file Code: e,g plugin.jquery.js I am not sure whether i am correct or not i think that plugin is coded by using $ sign not the $j and i think it will conflict with other libraries. So it means i have to chnage the plugin code as well or there is no need to change plugin Can someone correct me if i am wrong Hi all I have a page on a website I am creating that has both a lightbox rel link and a quick calculator to work out a size of a product. Here are the links to the java files I am using: <link rel="stylesheet" href="css/style.css" type="text/css" media="all" /> <link rel="stylesheet" href="css/jquery.lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="scripts/jquery.js"></script> <script type="text/javascript" src="scripts/jquery.lightbox.js"></script> <script type="text/javascript" src="scripts/swfobject.js"></script> <script type="text/javascript" src="scripts/sandstone.js"></script> <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> <script src="scripts/prototype.js" type="text/javascript"></script> <script src="scripts/scriptaculous.js?load=effects,builder" type="text/javascript"></script> <script src="scripts/lightbox.js" type="text/javascript"></script> Here is the actual lightbox link: <a href="testimage.jpg" rel="lightbox" ><img src="testimage.jpg" > And finally the calculator: <form method="post" action=""> <table width="220" border="0" cellpadding="2" cellspacing="0"> <tr align="left"><td width="87" height="30" class="meter-calc-text">Width (m)</td> <td width="117" height="30" align="left"> <input name="width" type="text" id="calc-width" size="6" /></td> </tr> <tr align="left"><td height="30" class="meter-calc-text">Length (m)</td> <td height="30" align="left"><input name="length" type="text" id="calc-length" size="6" /></td> </tr> <tr align="left"><td height="40" colspan="2"> <select name="packcontents" class="meter-calc-dropdown" id="calc-packcontents" onchange="updateProduct(this.options[this.selectedIndex].id)" style="width:140px;"> <option value="0" selected class="meter-calc-text">Product Select</option> <option value="1" selected class="meter-calc-text">1</option> <option value="2" selected class="meter-calc-text">2</option> </select> <input type="button" name="go" value="Go" id="calc-trigger" class="calc-go" /> </td> </tr> <tr> </tr> </table> <table width="220" border="0" cellpadding="2" cellspacing="0"> <tr> <td width="83" height="30" class="meter-calc-text">You Requi </td> <td width="121" height="30" align="left" class="product-cell-info-table-text"> <input name="meters" type="text" class="small" id="calc-meters" value="" size="5" /> <span class="meter-calc-text">m2</span> </td> </tr> <tr> <td height="30" class="meter-calc-text"> </td> <td height="30" align="left" class="product-cell-info-table-text"> <input name="packs" type="text" class="small" id="calc-packs" value="" size="5" /> <span class="meter-calc-text">Packs</span> </td> </tr> </table> <input type="hidden" name="productid" id="productid" value=""> <div id="addit" style="display:none"> <a name="addit" class="meter-calc-text" onclick="location.href='basket.php?action=add&id='+$('#productid').val()+'&quantity='+$('#calc-packs').val()+'&return=http://www.cq-designs.co.uk/clientarea/sandstonecentre/clientarea/sandstonecentre/product.php?category=2&type=&colour=1'">Add To Cart</a> </div> </form> The problem I am having is that they both don't work together. If I comment out the lightbox javascript the calcukator works but not the lightbox and Vice Versa! Please help Thanks Pete hi guys i really dont understand where i am going wrong.I've read countless articles including http://blog.nemikor.com/2009/10/03/u...ons-of-jquery/ but still having trouble with multiple versions of jquery not working. either the jquery slideshow doesnt work or the jquery ie select width fix doesnt work! rrghhh Code: <head> <link href="/css/styles.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="/ie6pngfix/iepngfix_tilebg.js"></script><!-- ie6 png fix --> <script type="text/javascript" src="/js/ddlevelsmenu.js"></script><!-- drop down menu js --> <script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script><!-- slideshow jquery file 1 --> <script type="text/javascript" src="/js/slides.min.jquery.js"></script><!-- slideshow jquery file 2 --> <!-- slideshow jquery controls --> <script type="text/javascript"> jQuery(function () { // Set starting slide to 1 var startSlide = 1; // Get slide number if it exists if (window.location.hash) { startSlide = window.location.hash.replace('#', ''); } // Initialize Slides jQuery('#slides').slides({ preload: true, preloadImage: 'img/loading.gif', generatePagination: true, play: 5000, pause: 2500, slideSpeed: 1200, hoverPause: true, // Get the starting slide start: startSlide, animationComplete: function (current) { // Set the slide number as a hash // window.location.hash = '#' + current; } }); }); </script> <script type="text/javascript"> var jQuery_1_4_4 = $.noConflict(true); </script> <script type="text/javascript" src="/js/prototype.js"></script><!-- lightbox aka image viewer js file 1 --> <script type="text/javascript" src="/js/scriptaculous.js?load=effects,builder"></script><!-- lightbox aka image viewer js file 2 --> <script type="text/javascript" src="/js/lightbox.js"></script><!-- lightbox aka image viewer js file 3 --> <script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready(function(jQuery) { </script> <script type="text/javascript" src="/js/test/jquery.1-4-2.min.js"></script> <script type="text/javascript" src="/js/test/jquery.ie-select-width.js"></script> <!--[if lte ie 6]> <script type="text/javascript" src="/js/test/jquery.bgiframe.js"></script> <![endif]--> <script type="text/javascript"> $(function () { // Set the width via the plugin. $('select#fixed-select-no-css').ieSelectWidth ({ width : 200, containerClassName : 'select-container', overlayClassName : 'select-overlay' }); // Set the width via CSS. $('select#fixed-select-css').ieSelectWidth ({ containerClassName : 'select-container', overlayClassName : 'select-overlay' }); // Borders and padding etc for Internet Explorer 6/7. $('select#select-styleable').ieSelectWidth ({ containerClassName : 'select-container', overlayClassName : 'select-overlay' }); }); </script> <script type="text/javascript"> var jQuery_1_4_2 = $.noConflict(true); </script> <!-- Share this button script --> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'c0b04a1e-f627-42e8-b040-cbfb63bd9b1c'});</script> <script type="text/javascript" src="/js/showtab.js"></script> </head> I've tried re ordering the scripts around but still no joy? either the slideshow works or the ie select width fix doesnt but not both at the same time? please advise Omar. Hello all I have been trying in vain for many days to resolve a conflict between javascript libraries. I have read far and wide and still have failed to fix this problem, most likely because my programming skills are just about copy and pasting. My homepage uses jquery horizontal css menubar + a combined mootool and prototype accordian type sliding information box in the middle of the webpage. I find that the highlighter of the css menubar does not work when prototype.js is also loaded on the same page. I have read somewhere that $ should be replaced however I have tried every possible option and none works. I have jquery loading first as it is on my template, with this <script type='text/javascript' src='../Web/Templates/jquery-1.3.2.js'></script> <script type='text/javascript' src='js/example.js'></script> And my mootool and prototype loades further below like this <script type="text/javascript" src="scripts/intro/prototype.lite.js"></script> <script type="text/javascript" src="scripts/intro/moo.fx.js"></script> <script type="text/javascript" src="scripts/intro/moo.fx.pack.js"></script> <script type="text/javascript"> function init(){ var stretchers = document.getElementsByClassName('box'); var toggles = document.getElementsByClassName('tab'); var myAccordion = new fx.Accordion( toggles, stretchers, {opacity: false, height: true, duration: 600} ); //hash functions var found = false; toggles.each(function(h3, i){ var div = Element.find(h3, 'nextSibling'); if (window.location.href.indexOf(h3.title) > 0) { myAccordion.showThisHideOpen(div); found = true; } }); if (!found) myAccordion.showThisHideOpen(stretchers[0]); } </script> Could someone please offer me further assistance and enlighten me what other information you require to assist me further. I have attached the example.js inside example.zip file if someone could kindly edit it for myself. Looking forward to your assistance. Sincerely, Lex Hey guys I should preface this by saying that this is not for my own site, or my own code; a friend has gone on holiday and needed this project fixing while he was away. Unfortunately my experience with jQuery is almost nil and everything was coded by someone else, so I'm really tearing my hair out. This is a Wordpress installation running Thematic with two child themes, one of which uses Ajax calls to grab page content. The issue is that the Ajaxified calls stop the swfObject content from being loaded. Compa http://dev.segolondon.com/wp292/media/ <- Flash content loads versus: http://dev.segolondon.com/wp292/#wp292/media/ If you take a look at the code of the two pages, you'll see there are no swfobject.embedSWF() calls on the Ajaxified page. It seems as though the jQuery calls are pre-empting the JS/Flash detection, so the swfObject code is never even written to the page. The actual custom, handwritten code (i.e. not from a library or a plugin) on this site is minimal, so I'm grasping at straws to fix this. I read somewhere about using a script block like this: Code: <script> $(document).ready( function() { // Make the swfObject call } ); </script> But I'm not really sure where to put it since there are so many plugins used, all with slightly different embed methods. Any help would be very gratefully received! Hi, I am trying to make the below jquery code to work, and the second click event does nothing. I understand this probably relates to the document ready section, that I am calling my form in the first click, but I am not sure the way around this. I have seen mention of using unbind, but I am not sure if it would apply in my case? My code is: Code: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function (){ $('#submitmessage').click(function(){ $('#messageboard').load('getloadCompose.php', function (){ $.ajax{(url:'getloadMessageBoard.php', sucess:function (result){ $("txtHint").html(result){ $('#submitFirst, #submitSecond').click(function(){ var btn = $(this).attr('id'); if(btn == 'submitFirst){ file = 'insertFirst.php'; Msg = 'Your comment has been registered; } else if(btn == 'submitSecond'){ file = 'insertSecond.php'; Msg = 'Your report has been registered; } var data = $('#messageboard').serialize(); $.post (file,data, function(){ alert(Msg); $('#messageboard').each (function(){ this.reset(); }); }); return false; }); }); }); }); }); }); </script> <body> <input type="button" name="submitmessage" id="sumitmessage" value="Add Message"> <div id="txtHint"></div> And then message board is: Code: <form action="" name="messageboard" id="messageboard" method="post"> <input type="text" name="subject" id="subject" value="Subject" /> <br /> <br /> <textarea rows="5" cols="40" name="message" id="message"></textarea> <br /> <br /> <input type="button" name="submitFirst" id="submitSecond" value="Send"> <input type="button" name="subitSecond" id="submitSecond" value="Report"> <br /> </form> This isn't the final form I shall be using, hence some of the names, I stripped back the form to basics to try and get it working in principle (and failed). So what I want to happen is the visitor clicks on the Add Message button (this will be from a list of choices) and then the messageboard form is called - it works up until here - then the visitor fills out the form and decides whether the want to send or report it. It is here that nothing happens, e.g. if the visitor clicks on either the report or send button there is nothing. If I have the form directly in the first page then this all works fine, it is just when I want to have an event calling the form that it doesn't work. As a very small aside, I took this bit of code $("txtHint").html(result){ from a tutorial which originally had the code phrased as $("div").html(result){ . The problem I have is that I have a number of divs with different names, so I tried to identify my div by using it's id "txtHint", the correct page is still being called but it is not being posted inside my div txtHint, the correct way of doing this would be appreciated. Please see URL: http://www.freedommd.com/Freedom10/index.shtml 1. On the navbar, click on "Demos > EMR Features" (using jQuery for the navbar) 2. On the "FreeDOM EMR" page, in addition to the jQuery navbar, I am using Lightbox to display images (click on the "dashboard" thumbnail). There is a conflict of some sort here between scripts. Code: <!--jquery menu code directly below--> <script type="text/javascript" language="javascript" src="js/jquery.js"></script> <script type="text/javascript" language="javascript" src="js/navmenus.js"></script> <!--end jquery nav--> <!--Lightbox code directly below--> <script type="text/javascript" src="js-lightbox/prototype.js"></script> <script type="text/javascript" src="js-lightbox/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="js-lightbox/lightbox.js"></script> <!--end Lightbox --> As is, on this page, my Lightbox code works fine, but my navbar will not expand the sub menus. If I remove the Lightbox code, then the navbar works fine. I'd really like for them both to work. : ) I tried putting the .js in different directories, separating the Lightbox code from the jQuery code but that didn't help. All .js files are attached. Much appreciated if someone can tell me what I need to do. Thanks, John I had this filterable thing working perfectly but seem to have done something that just makes all the items flash constantly when you try and filter (click the blue section All | Illustration | Animation). Can someone take a look and help at all? http://bit.ly/4yWiDZ I've been trying to get the jquery nivo slider and the lavalamb function to work on the same webpage. From each of the tutorials comes different versions of jquery and they don't both work on the most recent version of jquery. I left both versions of the jquery attached for now... Am I doing something wrong or is it possible to have them both working on the same page? I'm a noob and my code is pretty messy...but I'm trying to do some simple stuff... Pleeeeese help meeeee!! I'm getting ubber frustrated Here is the website - http://sethwardallison.com/ihome/index.html Here is the menu I made that is working correctly on it's own... - http://sethwardallison.com/ihome/lavalamp/other.html Here is my code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <html lang="en"> <head> <title>iHome Preview</title> <link rel="stylesheet" href="js/nivo-slider.css" type="text/css" media="screen" /> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <style type="text/css"> #nav {width:397px; background: url(images/bg2.gif) no-repeat top left; overflow:hidden; margin:0px; padding:10px 0px 13px 20px; color:#fff; position:relative; font: bold 14px arial;} #nav li {float:left; display:inline; list-style:none; line-height:35px; position:relative; z-index:3;} #nav li a { padding:0px 10px 0px; cursor:pointer; Palatino, serif; font-size:20px; display:inline; color:#fff; } #nav li.rounder { position:absolute; left:0px; top:10px; margin:0px; padding:0px; display:none; z-index:2;} #nav li.rounder img {position:absolute;} .cornersWrap {position:relative; height:25px; width:auto; margin-top:5px; background:#dfddc0;} #nav, #nav li, #nav li a, #nav li.rounder {height:35px;} #tl,#tr,#bl,#br {position:absolute; width:8px; height:8px; overflow:hidden;} #tr,#tl {top:0px;} #br,#bl {bottom:0px;} #tr,#br {right:0px;} #tl,#bl {left:0px;} #tr img,#br img {left:-8px;} #bl img,#br img {top:-8px;} </style> <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#nav li a").mouseover(function(){ $("#nav li a").each(function(count){ $(this).css({color:"#fff"}); }); $(this).css({color:"#663300"}); var offL = $(this).offset().left - $("#nav").offset().left; var offW = $(this).width() + parseInt($(this).css("paddingLeft")) * 2; $("li.rounder").stop().animate({left:offL+"px", width:offW+"px"},295,function(){ //IE6 1px Fix var trOff = $("#tr").offset().left + parseInt($("#tr").css("width")); var wrapWOff = $(".rounder").offset().left + parseInt($(".rounder").css("width")); var brOff = $("#br").offset().top + parseInt($("#br").css("height")); var wrapHOff = $(".cornersWrap").offset().top + parseInt($(".cornersWrap").css("height")); if(wrapWOff > trOff){ $("#tr,#br").attr("class","rFix"); } $(".rFix").css({right:"-1px"}); if(wrapHOff > brOff){ $("#br,#bl").attr("class","bFix"); } $(".bFix").css({bottom:"-1px"}); }); }); }); </script> </head> <body> <center><img src="images/logo.png" alt="" title="Welcome"> <div id="wrapper"> <div id="slider-wrapper"> <div id="slider" class="nivoSlider"> <a href="http://youtu.be/4Mh--oqL6ak"><img src="images/randall.png" alt="" title="" /></a> <a href=""><img src="images/creekwood.png" alt="" title="" /></a> <a href=""><img src="images/poinsettia.png" alt="" /></a> <a href="http://youtu.be/fO5q_lG7jKY"><img src="images/cielo.png" alt="" title="#htmlcaption" /></a> </div> <div id="htmlcaption" class="nivo-html-caption"> <strong>This</strong> is a<em>House</em> <a href="#">neat</a> </div> </div> </div> <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script> <script type="text/javascript"> $(window).load(function() { $('#slider').nivoSlider(); }); </script> <div> <ul id="nav"> <li><a href="#">Home</a></li> <li><a href="#">Product</a></li> <li><a href="#">Example</a></li> <li><a href="#">Contact</a></li> <li class="rounder"> <div class="cornersWrap"> <div id="tl"><img src="images/rounder.gif" /></div> <div id="tr"><img src="images/rounder.gif" /></div> <div id="bl"><img src="images/rounder.gif" /></div> <div id="br"><img src="images/rounder.gif" /></div> </div> </li> </ul> </div> </body> </html> Here's what should happen. 1. Get the rel attribute of the clicked link 2. For every div with class 'entry': (i)Get its 'left' position (ii) Calculate its outer height (iii)Loop through all instances of 'a.tag_filter'. If it finds the same string in the 'rel' as the one oringinally clicked on then add 1 to 'V' and break out of the loop. (iv)If 'V' is equal to 0 after the loop we know the same tag isn't present within that '.entry' so fade it out. (v)Once the fadeout has finished loop through all the '.entry' after the faded out one and get their 'left' values. (vi)If the left value of the faded entry = the left value of the current '.entry' then reposition it to the new 'top' value. What is currently happening. It runs through and fades out all the correct '.entry' elements and only after all of them have faded out does it reposition them remaining '.entry' elements. After each element is faded out I would like the repositioning loop to run so it essentially positions the remaining elements one at a time rather than all at once. Here's the development page http://www.redeemercentral.com/index.php/test/grid Here's the code I have so far Code: $('a.tag_filter').click(function(e){ e.preventDefault(); var selectTag = $(this).attr('rel'); $('div.spotlight_entry_container_grid').each(function(i){ var $entry = $(this); var tagArray = []; $('a.tag_filter', this).each(function(){ tagArray.push ($(this).attr('rel')); }); if($.inArray(selectTag,tagArray) == -1){ var leftPos = $entry.css("left"); var topPos = $entry.css("top"); $entry.fadeOut(1000, function(){ var nextLeftPos; var nextTopPos; $('div.spotlight_entry_container_grid:gt('+i+')').each(function(j) { var $laterEntry = $(this); nextLeftPos = $laterEntry.css("left"); nextTopPos = $laterEntry.css("top"); if(leftPos == nextLeftPos){ $laterEntry.animate({ top: topPos }); } }); }); } }); }); I hope that all makes sense. Any help would be very much appreciated. Thanks I am going through the example at the bottom of this page: http://api.jquery.com/jQuery.getJSON/ I am using the following code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <script src="http://code.jquery.com/jquery-1.4.4.js"></script> </head> <body> <script> var id=$("#id").attr("value"); $.getJSON("json.php",{id:id},dates); function dates(datos) { $("#list").html("Town:"+datos[1].rsTown+"<br>"+"County:"+datos[1].rsCounty); } </script> <div id="id"></div> <div id="list"></div> </body> </html> and I'm trying to pull my JSON data from my PHP page: http://www.mypubspace.com/dashtest/json.php the JQuery seems to be doing something but nothing is being output to my screen?! project page http://www.mypubspace.com/dashtest/json.html Please help?! So, i have this code which retrieves php files for me using jquery and id love to get it working with Jquery history plugin. I tried modifying the code i got from the ajax demo to work for me, but i just couldnt do it as i do not know any javascript really.. ( actually what i tried was simply to change "#ajax-links a" to "#menu li a" and .html to .php ..but nothing.. :rolleyes: Id be very gratefull if someone would help me out with this one. All related code can be found bellow (the ones that should be needed anyways): This is the code that retrieves php files inside "#content" when item from "#menu li a" with the specified id is clicked Code: $(document).ready(function(){ //References var change = $("#menu li a"); var loading = $("#loading"); var content = $("#content"); //Manage click events change.click(function(){ //show the loading bar showLoading(); //load selected section if(this.id == "home") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/index.php", hideLoading); content.slideDown(); } else if(this.id == "secondpage") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/secondpage.php", hideLoading); content.slideDown(); } else { //hide loading bar if there is no selected section hideLoading(); } }); //show loading bar function showLoading(){ loading .css({visibility:"visible"}) .css({opacity:"1"}) .css({display:"block"}) ; } //hide loading bar function hideLoading(){ loading.fadeTo(1000, 0); }; }); Heres the structure of the menu/content Code: <ul id="menu"> <li><a id="home" class="normal" href="#Home"></a></li> <li><a id="secondpage" class="normal" href="#Secondpage"></a></li> </ul> <div id="content"> <ul id="sec-menu"> <li><a id="link1" class="normal" href="#">Link1</a></li> <li><a id="link2" class="normal" href="#">Link2</a></li> </ul> </div> Heres the code that jquery history plugin uses in demo for ajax Code: jQuery(document).ready(function($) { function load(num) { $('#content').load(num +".html"); } $.history.init(function(url) { load(url == "" ? "1" : url); }); $('#ajax-links a').live('click', function(e) { var url = $(this).attr('href'); url = url.replace(/^.*#/, ''); $.history.load(url); return false; }); }); hi, i have a jquery problem... this script is not working with jquery-1.4.2.min, but it works with jquery-1.2.6.min.js, can anyone help me???the script is the above: (it is not working the tab actions, the slideout works...) http://www.benjaminsterling.com/wp-c...es/sidetab.htm the javascript code is the above: PHP Code: var jqsideTabs; var tabs, h = 50, r = 0,ra = 0; $(document) .ready(function(){ jqsideTabs = $('#sideTabs').addClass('closed'); tabs = jqsideTabs .find('.tab h3') .clone() .appendTo(jqsideTabs) .each(function(i){ var that = $(this), cls = '',ow,newThis, newEl; if( i == 0 ) cls = ' active'; newEl = $('<a href="#" class="tabLinks'+cls+'">' + that.text() + '</a>'); that.replaceWith(newEl); ow = newEl.outerWidth(); if( i == 0 ) ra = ow; else r = ow; h = newEl.css({'top':h , 'right': -ow }).height() + h; newThis = newEl.get(0); newThis.jq = newEl; newThis.i = i; newEl.click(function(){ var el = this.jq; if( jqsideTabs.hasClass( 'closed' ) ){ jqsideTabs.removeClass('closed'); } else if( !jqsideTabs.hasClass( 'closed' ) && el.hasClass('active') ){ jqsideTabs.addClass('closed'); } el .siblings() .removeClass('active') .css({'right': -r }) .end() .addClass('active') .css({'right': -ra }); tabs.eq( this.i ).show().siblings('.tab').hide(); return false; }); }) .end() .parent() .eq(0) .addClass('active') .end() .filter(':not(:eq(0))') .hide() .end(); jqsideTabs.bind("mouseleave",function(){ jqsideTabs .animate({left:-310}, 'fast', function(){ jqsideTabs.addClass('closed').removeAttr('style'); }); }); }); and the html file is: [HTML] <div id="sideTabs"> <div class="tab"> <h3>Tab 1</h3> <div class="gut"> <p>Some text</p> </div> </div> <div class="tab"> <h3>Tab 2</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> <div class="tab"> <h3>Tab 3</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> </div> [/HTML] the problem is that the tab button works, but the content doesnt change...in all of tabs showing the same text(showing all tbas content).... can anyone help...please..... i keep getting the error GET http://code.jquery.com/jquery.min.map net::ERR_TOO_MANY_REDIRECTS & Failed to load resource: net::ERR_TOO_MANY_REDIRECTS when i load my page...and the havascript doesn't work properly on ym page...how do i resolve this. thanx in advance Hi Guys. I wish I could say I was a fellow coder but I'm not. I am a WYSISYGer that promised to help a friend and is lost. I'm making her a site that is based on a js template. I want to add a lightbox effect using jquery. Ive been trying to use a plugin called bumpbox because unlike lightbox it allows static html in the popup. When I implement the plugin in a very basic html doc, it works just fine. However when I use it in my js site, nothing happens. I really really don't understand what I am doing right or wrong, so if someone could take a look at code and help me out (with very basic instructions), I'd really appreciate it! Ive uploaded site to http://www.flashfollow.com/index.html click home>link saying seo it should open a lightbox...currently to developers site. THANKS SO MUCH Heya there, I have been trying to run two Javascripts within the same page. The first is the Drop down menu Javascript, the second is the Picture Viewer (Click an image and it opens) Here is a copy of the webpage (the active version has been modified to reduce confusion for users) http://f1p.co.uk/saved%20pages/picture1.html I have tried a noconflict, but it didn't seem to work. As you can see, the Picture viewer works fine, but the drop down menu seems to be in conflict. Any help please? |