storing an span content to a variable without getting an error
I'm trying to embed a lot of html code into a javascript variable. How do I do that without getting error? I kinda think that it has something to do with the escape quotation plus x, which I need so that the id won't duplicate. is there a better way to do this? Thanks //add new form //update cached steps in the wizard with a new step (adds one first) $(".addcar").live(click,function(){ //step 2 vehicle information content if (x == null)
.click() issue
So I'm making a button for a function that requires the user to make sure s/he wants to use that function. You click the button and two links appear inside the button, yes and no. The initial click event in binded through jquery. I unbind the click event when the button is clicked and change the html (using .html()) to "Sure? yes / no". Upon clicking no, I want the button to return to it's original state. So you click the "no" link, which is inside the button, and I change the html back and rebind
How to write If condition in jquery.
Hello Friends, I very new to jquery. I am using show and hide div function in my web site. There are number of DIV tags. I just want to hide / show perticular div on links click event. how should I achieve this. My Jquery code is as follow - <script type="text/javascript"> function showSlidingDiv() { $("#DivWomenHostel").animate({ "height": "toggle" }, { duration: 1000 }); $("#DivGentsHostel").animate({ "height": "toggle" }, { duration: 1000 }); $("#DivGirlsHostel").animate({
Hover navigation controls hidden content: when I hover over all buttons too quickly, they all stay visible?
Hello. It's probably easiest for you to just slap my code into an html file and take a look. I can't figure out why all the corresponding nav content items stay open if you hover over them quickly. Try it: Run your mouse over the nav from left to right, or right to left very quickly. All 5 of the corresponding div's that display will stay on screen. Yet the function clearly states to hide all others if you hover over one. There is also a mouseleave handler that is supposed to hide ****. If you do
Form submit with ajax
Hi everyone. I'm facing problem in submitting 2 different forms at the same page through ajax. Now my 1st form (Single form) is working correctly but 2nd form is posted to exact file but its not submitting the required form elements (inputs) its submitting my 1st forms elements.. Simply we have 1 page, 2 forms with different actions files.. how we can make it working in jquery. $("#ajax-form").submit(function(){ /*Loading gif*/ $('#add-res').css({display: 'none',color: 'white'});
Problem jQuery menu
Hello I want to make the same menu style than http://www.toyota.fr (the one with cars). Here's my attempt: $ (Function () ( runEffect function () ( $ ("# MaDIV"). Show ('slide', 500, callback); ) function callback () ( if ($("# MaDIV "). MouseEnter ()){$("# MaDIV"). bind ("MouseLeave", function () ( $ ("# MaDIV: visible"). RemoveAttr ('style'). Hide (). Fadeout ();}, 5000);) else
$('#homefeature').mouseleave(function() { does not even work?
I've had this problem with other sites as well since I started using jQuery a year ago - the function simply does not work as expected. I have also tried the jQuery mouseout as a substitute and it literally does not do anything, not even an alert will fire when I wave my mouse in any manner, frantically or otherwise over the specified element, which have always been div's with an ID. Is there some trick to getting this to work or what the heck am I doing wrong!? Here is the function in its entirety:
Select n children
Hello I need to select the two first cells in each row of a table, BUT :nth-child only allows 1 argument. For example I tried $('tr td:nth-child(1-2)') $('tr td:nth-child(1,2)') $('tr td:nth-child(<2)') $('tr td:nth-child(:lt(2))') But aint working. Pure :lt() selects the first two cells of the table only, so does slice(0,2) Why is jQuery lacking such an important function, "select n children" with arguments (range, 3-8 or just 2, which equals 0,2 or 0-2)...?
Combobox doesn't retain values after "back" on chrome
I've got a page with a bunch of select comboboxes. If the user clicks a link, and then goes back to this page, the selected items change. This seems to happen only in Chrome, it works fine in IE7. It turns out that if I remove the addition of jquery-1.3.2.min.js then the comboboxes work as I expect. I have a real simple test case that demonstrates the issue. You can see the first time you load this, Audi is selected. But if you click on "foobar" then click back, Volvo will be selected. Perhaps this
how do you unload an html, after it has been loaded?
I have figured out how to load a fragment into a container but "unloading" is not as clear. Can someone suggest how to do this properly? I tried load() with no arguments and unoad() but nothing works quite right... help? thanks!
Syntax and runtime error management with ajax/getScript includes.
I ran a couple of searches in the forum and I didn't find anything to help me. I'm wondering if there is a predetermined way of validating syntax and runtime errors in .js files loaded with either the getScript or ajax methods. At the moment, in my setup, firebug reports errors seemingly randomly in the head section of the current html page and does not point to the correct line in the external js file or at least understands where it comes from. I know its not eval()-ing the code and that it just
trouble with adding a class to all "not selected"
for some reason, after a couple of seconds the clicked on div acquires the "fade" class even though in theory it is still a "div-selected" and not a div:not(.div-selected)...what am I missing??? $(".content-item").click( function(){ $(this).addClass('div-selected', 500); $('div:not(.div-selected)').addClass('fade').show('slow'); $(this).css("z-index","100") } );
return false not working
Hi All, Probably an easy one, I have the following code... $('.subitems').find('li').each(function(i) { $(this).find('a').bind('click', function() { $('.fade').hide(); $('.fade').eq(i).show('fast'); event.preventDefault(); return false; }); }); However whenever I click on the link it still goes to the top of the page. Any Ideas?
Passing events through an element
Hey, Please pardon my ignorance if this topic has been discussed before - I couldn't construct a search query that returned anything of the like! Currently I have a set of two div elements, both of which span the width and height of the window. The top div plays host to a user interface, and the bottom div to various editable elements. The problem here lies in the fact that the user interface div is intercepting all mouse events, and as such neither the lower div nor any of its children may be interacted
Trying to add a Click function on image
Hi, I'm a newbie and I'm trying to get this code to also have a click function on the image that would advance to the next image .. any advice would be appreciated. Thanks! $(function() { $('#slideshow').cycle({ fx: 'fade', timeout: 6000, prev: '#prev', next: '#next', after: onAfter }); function pagerFactory(idx, slide) { var s = idx > 2 ? ' style="display:none"' : ''; return '<li'+s+'><a href="#">'+(idx+1)+'</a></li>';
JQuery accordion menu problem in IE8
Hi all. I'm new to jquery and javascript, and I'm doing a site with a drop-down accordion menu. It actually has two drop-down menus on the page, a horizontal one along the top, and a vertical side menu. (For the record, I'm using the accordion menu found here: http://www.i-marco.nl/weblog/archive/2010/02/27/yup_yet_another_jquery_accordi) The default menu code uses a .click() event on a "li" to initiate .slideToggle and .slideUp actions. This is fine for the side menu, but the top menu requires a
.slidetoggle and IE8 - only slides up, never slides down
I'm not sure what the issue is here as the audiospace and videospace slideToggle's work perfectly fine. The last one, downloadspace, only slides up and never slides down in IE 8. It works in Chrome just fine. What gives? Here is my code, not sure what is going wrong. I've gone over the code over and over and now it's starting to blend together... ;) Here's an example of what's happening <script> $(function() { // document.ready /* $('.audiospace').hide(), $('.videospace').hide(), $('.downloadspace').hide();*/
newbie learning jquery
I'm learning jQuery with XML. I'm familiar with other query languages such as XPath. I'm having a little bit of difficulty wrapping my brain around how jQuery works but I think I can make the leap if I see a solution to a problem I know how to solve with other methods. I'd appreciate your help with an example. Given the following XML, please share a jQuery solution to finding the value of attribute B in elements named bar where attribute A has the value 30: <foo> <bars> <bar A="99"
Need help with a progress bar
I would like to add a fundraising progress bar to a web site. Searched here for code. Perhaps I was using the wrong terminology, but couldn't find anything. I don't want a thermometer look - prefer a horizontal bar. Can anyone point me to a plugin or download?
Problem while using jQuery before() function for inserting an element before the last element.
Hi, I am trying to insert a div before the last element using before() function.For the first time it is working.When i try to add another one before the last element ,the first one is getting replaced with the second one,instead of creating it below the first one.The thing is that i am creating the html content dynamically. Pls provide any hint. ~Ragesh Kumar A.K
fadeIn not functioning correctly in IE
I have three span tags, each containing a word. They are all slightly overlaid. Initially they are all set not to be visible using: $("#home-feature div.home-feature-item:eq("+(i-1)+") span").fadeOut(0);Each item is then faded in, one after the other, using: $("#home-feature div.home-feature-item:eq("+(eq)+") span:eq("+j+")").fadeIn(500);The fade effect is working perfectly in Firefox, Safari, and Chrome. Each span tag is absolutely positioned, with an appropriate z-index set. Disabling Javascript
.val() in ie
the follow piece of code don't work in ie, and I don't know why. I'm stucked with this. Ie throw a js error. It seems that it can't find the .val() method is not supported; I tryed with the classic document.getElementById() but I find out the same error. Someone could help me, please? <script type="text/javascript"> $("#btn_filtra").click(function(){ filtro=$('#filtro').val(); tableName=$('#tableName').val(); var url="lista_visualizzazione.php?tableName="+tableName+"&filtro="+filtro; $("#lista").load(url);
JQuery RadioButton setting functionality doesn't work in IE
My problem is quite annoying, probably something really stupid but I've been going around it and didn't find a solution.I call in 2 different pages to this partial view: <div id="pNotification"> <p> <strong><%= Html.Label("Status :") %> </strong> <input type="radio" name="NotificationStatus" id="statusA" value = "A" checked = "checked"/> <label for="statusA">Active</label> <input type="radio" name="NotificationStatus" id="statusN" value = "N" /> <label
Strange and unexpected behaviour of $.ajax, error and localhost
Hello, I found this behaviour of $.ajax using this simple code. I tested this on Firefox, Chrome and Safari (not on IE :| ). I'm using jQuery 1.4.2 Suppose you have this code: function test() { $.ajax( { url : 'test/GameConfiguration.json', dataType : 'json', data : { a : 'aaa' }, cache : false, method : 'get', timeout : 10000, //10 secs of timeout success : function(data, textStatus, XMLHttpRequest) { console.log("success"); if (data == null) console.log("it's not a real success"); }, error : function(XMLHttpRequest,
Jquery script with cookies
I have a script that open up a fancybox form once browser closed/refreshed/back is pressed (onbeforeunload). Now I'm trying to make the fancybox pop up only once so i installed the cookies plugin and started to play with it but it doesn't seems to work , maybe you can help me here <html dir="ltr"> <head> <script type="text/javascript" src="jquery14.js"></script> <script type="text/javascript" src="jquery.cookie.js"></script> <script src="fancybox/jquery.fancybox-1.3.1.pack.js" type="text/javascript"></script>
load content works in IE but not in firefox
with the folowing code i load over the funktion golabel the content in a div. so fare it works in IE fine. why does it nork in firefox? function golabel(url,label,hoehe) { if (movieIsLoaded(thisMovie(movieName))) { thisMovie(movieName).TGotoLabel("_level0/",label); $('div#header').height(hoehe); $('div#flashslide').height(hoehe);} //obmain = document.getElementById('nav'); pageTracker._trackPageview('url'); var toLoad = url; $('#content').hide('fast',loadContent);
How to prevent script from starting new animation while old one still lasts???
How can I make the script below "stop responding" when it's already animating? I want the script below to animate ONCE and STOP animating (even if mouse is still on element #s2) until I take mouse off it and hover again. This is what I'm using: http://jquery.malsup.com/cycle/ <script type="text/javascript">$('#s2').cycle({ fx: 'scrollDown', timeout: 0, speedIn: 2000, speedOut: 500, easeIn: 'bounceout', easeOut: 'backin', delay: -2000, prevNextEvent: 'mouseover.cycle',
JQuery $.ajax calls success method on timeout, instead of error, running in Safari or Chrome
Hello, I've noticed this weird behaviour of jQuery in Safari and Chrome (didn't test on Firefox as I'm using some webkit CSS extensions). After setting up the call like this: $.ajax( { 'url' : url, 'dataType' : 'json', data : reqdata, cache: false, method: 'get', timeout: 20000, //10 secs of timeout success : function(data, textStatus, XMLHttpRequest) { console.log("success"); if ((data === null) || (data.length == 0)) { ts.doAction( { 'actionName' : 'timeout', 'request' : { 'reqdata' : reqdata,
Insert nested tags
Hello everyone, I've got a problem which should be easy, but somehow it doesn't work. I want to insert a nested <div> into an existing span in a number of table cells, each of which has different content, so: <td><span>Content</span></td> would be 'converted' to <td><span><span>Content</span></span></td> I have tried: $('tr td span').prepend("<div>"); $('tr td span').append("</div>"); However, this actually seems to produce <td><span><div></div>Content</span></td> I have also tried something along
$.param() - serialization problem
var a=[{"a1":"v1", "a2":"v2"},{"b1":"v1"}]; var b=$param(a); jquerry 1.4 gives: undefined=undefined&undefined=undefined is there a method that would serialize this array of objects properly?
checkbox problem
hi i have a series of checkbox in my page, each one has its own value. i want to return this value when user click on eachbox, plus ststaus of checkbox (checked/unchecked). i wrote this code, but it always return first checkbox value: cb1: <input name="cb[]" type="checkbox" value="1" class="cb-compare" id="cb-compare-1"><br> cb3: <input name="cb[]" type="checkbox" value="2" class="cb-compare" id="cb-compare-2"><br> cb3: <input name="cb[]" type="checkbox" value="3" class="cb-compare" id="cb-compare-3"><br>
Display problems with verifying a form with "Remote"
hello, when i write in the email input text : - an email saved in the data base, the red outline of the other text input disappear abnormally. - an email properly structured email (no saved in the data base), the message "Adresse email déjà utilisée" appears for a few seconds, then it should not. thank you in advance for your help and here is my code : translation.tmx... <tu tuid="errorLBoxEmail"> <tuv xml:lang="fr_fr"><seg>Email incorrect</seg></tuv> <tuv xml:lang="en"><seg></seg></tuv>
Help removing and reinitiating new a easySlider instance
I'm using easySlider and masonry but I'm having problems in using multiple instances of easySlider. What I'm trying to do is to remove the first instance of easySlider and then create a new instance that has new set of images. Here's a demo: http://keanetix.co.cc/folio2010 But it doesn't seem to work correctly. When you click box#1 (CM Partners) the slider works great. But when you click on box#3 (NBCM), the slider doesn't work and notice that it adds a 'Previous' link even though it's the first
Combining document ready functions?
Hello, I'm using a simple show-hide script on various IDs. The issue is as it stands right now each is a seperate JS that calls the document ready function via jQuery. Is there a way to combine this into one more flexible script or at least into one script in some form or another. Thank you so much for your time in advance! Below is an example: <script type="text/javascript"> $(document).ready(function(){ $("#loadDummy7").hover( function () { $("#dummy7").show(); }, function () { $("#dummy7").hide();
Can someone tell me what I'm doing wrong?
Admittedly, I am not a jQuery expert. I am trying to use a simple slide animation in Firefox using Ubuntu 10.04. I want one div to disappear and then another div to slide in from the right or left. This is the code I'm using: $('a#words').click(function() { $('div#spacer').hide().end() $('div.options').show("slide", { direction: 'left' }, 500) return false; }); These are the script tags I'm using in my header: <script type="text/javascript" src="scripts/jquery.effects.core.js"></script>
inserted ajax drop down won't fade on formwizard
Hi, I'm using formwizard, and I tried to insert a dropdown into the form by putting this jquery code $('#aog').change(function() { if ($('#aog').val()==='yes') { $.ajax ({ type: "POST", url: "<?php echo base_url(); ?>index.php/register/mortgator", data: "aog=" + $('#aog').val(), success: function(msg) { $("#bank").html(msg);
Does jQuery impact a tag before it?
I don't have access to change the title manually and I can't put jQuery before title tag. can I through Query change the text in title? See the example code below <title>hi</title> jQuery code here <div>...</div> Thanks Bahtimir
onclick with different href url for lightbox
Hi All, This is my first post in this forum.Well lets go to the point. I am doing a lightbox effect onclick a image.Its easy if I just use this code: <a href="images/image-0.jpg" class="lightbox" title="Cape Breton Island"><img src="images/thumb-0.jpg" width="100" height="40" alt="" /></a> <script> $(document).ready(function(){ $(".lightbox").lightbox(); }); </script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
What is the jQuery equivalent to this getElementsByName?
So what would be the jQuery equivalent to this standard getElementsByName set of code? for (var index=0; index<document.getElementsByName("amount1").length; index++) { total = total + document.getElementsByName("amount1")[index].value * document.getElementsByName("amount2")[index].value; } document.getElementById("totalAmount").innerHTML=total;
Rotating Quotes with jQuery
I have created a small rotating quotes display in jQuery. Here is a link to a test page with the quotes: http://www.upward.org/cheercoordinator/_tempFiles/test.aspx Here is my issue. My source is the same on staging and production. However, in my staging environment the quotes rotate (fade-in and fade-out) without issue. On my production site the rotating quotes keep repeating the second quote. I do not see what the issue could be so I am asking for additional eyes to look at it. -----------------------------------------------------------------------------------------------------
Next Page