Jquery and IE8
Hello everyone, I have the following peace of code. $(document).ready(function() { $("ul.submenu").hide(); $("ul.dropdown").hide(); $("li.menuparent").each(function(index) { var menuparentid = $(this).attr("id"); $(this).hover(function() { $("ul.dropdown[id*='"+menuparentid+"']").slideDown('slow').show(); $("ul.dropdown[id*='"+menuparentid+"']").children().each(function(){
Javascript variable scope and un-named functions, what are the rules?
I've recently started developing javascript using jQuery and so far I'm really enjoying it. Being a professional programmer (mainly C, C++, java and python) there is one thing that's been puzzling me regarding variable scope and unnamed function declarations. Let me exemplify: ------------------------ var sum = 0; $(xmlobj).find("item").each(function(){ sum += parseFloat($(this).attr('value'); }); alert(sum); //this will alert the sum of each item ----------------------- BUT ----------------------
Hiding a div in response to data not being found
I have a grid that is being displayed with data that comes from a static xml file. I need to conditionally display a div in response to whether data is present at a particular xml node. Is there a way to do this via jQuery?? I have tried doing it via straight js, but all I end up doing is permanently hiding the div I am messing with. if data within the xml node is present - display the div. If no data is present in the xml node - hide the div. But my code below permanently hides the div. Help.
livequery issue
Hello, When I use livequery like this it works perfectly: $('a') .livequery('click', function(event) { alert('clicked'); return false; }); But when I want to use it with another plugin like contextMenu, it doesn't work ... $("#selector").livequery("contextMenu({ menu: 'myMenu'}", function(action, el, pos) { alert(action); }); Does anybody knows what I am doing wrong here? I'm have searched but I'm only a beginner ... Thank you for any help! Christophe
problem with a form
Hi everyone! I've got a very simple form: <label for="zodiac">Choose your zodiac sign:</label> <select name="zodiac" size="1"> <optgroup label="Your zodiac sign:"> <option value="leo">Leo</option> <option value="virgo">Virgo</option> </optgroup> </select> <label for="more">Tell me more about you:</label> <select name="more" id="leo" size="1"> <optgroup label="Tell me exacly about your leo sign:"> <option value="first">I am from
attribute removing
Hi, somebody can tell me why, if i use .removeAttr , .removeClass , attr( 'id', ' ' ) , with the aim of removing some attribute; then i check in firebug, the attribute is removed correctly, but, the selector based on this attribute continue to select the element even it hasn't the attribute required for the call?? many thanks!!
need help with onload
Hi, I have some code that is triggered by .change but I also need to trigger it onload and I'm not sure how I would do that. Any help would be great. Also this is a small example the real code is dynamic which is why I'm not using ids for the select list, there could be 1 or 100. thx Daniel <script type="text/javascript"> $(function() { $('select').change( function() { $(this).closest('tr').find('.target').html(1.0-($(this).find(":selected").val())); }); }); </script> <table> <tr> <td><select>
Background That Moves With Cursor
I am after a jquery (or other?) solution that mimicks this: http://www.ageofconan.com Notice how the background moves slightly based on cursor movement? I think I have seen it done somewhere using libraries before, not sure where though. Any help would be much appreciated, thanks in advance.
Trouble with Tabs
Hi everyone, I am using jQuery UI Tabs and have a couple questions. Jump to the last sentence for a recap of my questions. The tabs are dynamically added after the rest of the page loads: function add_monitors(){ $.post("skins/new/includes/getMonitors.php", function(data){ var monitors = data.split(","); // Put monitors into array monitors.pop(); // Pop off last monitor (it is blank) var x = monitors.length; // Number of monitors for (var i=0;i<x;i++){ // For each monitor var
$.post problem
Hi all, I am working in a php (code igiter ) project in which i use jquery for data transfer and validation. The $.post function is working fine in many cases but at one place the response is NaN. i mentioned datatype as html. any one help me here..
Jquery: Take # from input and create div
down votefavorite Hey Guys, I have a few inputs which allow people to input a number (in px) for width, one for the # of columns, and another input to set the margins for each div.. Using jquery, how do I take these numbers and create these divs with the proper width and margins? Example: [Input] Width: 960px [Input] # of Columns [Input] Margins Basically I am trying to show how the set up will be so the user will see the divs with margins . ----Code----- <form method="post" action="<?php echo $_SERVER['PHP_SELF'];
HTML manipulation problem ( with multiple script)
Hey, i just learned jQuery and i am really excited to work with it! I got my code for adding my table ( HTML manipulation ) But the problem is, that if u click an empty row, it need to change letter from S to Z ( and empty ( space ) ) So, i actually don't know how i can use those multiple's, so i started scripting from just an space to S ... it didn't work.. but i was sure my script works, so i used it on other page .. and it worked ... here is my code <script type="text/javascript" src="jquery.js"></script>
ajaxStart, ajaxStop will always work
ajaxStart, ajaxStop will always work when $. ajax $. or $ post. load are triggered. How do I use only once ajaxStart, ajaxStop
ajax response is 503
Hello, I am trying to send data of form using $.ajax function (especially I am doing chat for phpBB3), but while posting non UTF-8 characters, everything is ok, however, if I will send "+ľščťžýáíé=", it will lead me to status = 503, and I am not sending it in script. Is possible that this is bug, or I do not know how to send UTF-8 characters, but I tried anything I found on the internet: async, dataType, contentType; but nothing helped me. Thanks in advance for any reply!
Use URL to show corresponding div id
I was wondering if some one could help me out. I am not very knowledgeable when it comes to jQuery but I would like to be. I would like to have some jQuery that will look at the url and based on what directory it is pointing to, it will "activate/show" a corresponding div. Here is the code I have to show the first div in a list of div's when the page loads. But I would rather this load the div that the url says: $(".tab_content").hide(); //Hide all content $("#navbar ul li:first").addClass("active").show();
Why is this background position animation jumping instead of easing?
Can't figure out why this background animation is jumping. Code and link are below: www.paragonhondainfo.com jQuery(document).ready(function(){ jQuery('.program_info_2').hover( function() { jQuery(this).animate({height: '242px'}, {duration:300}); jQuery('.program_info').stop().animate({height: '183px'}, {duration:300}); jQuery('#masthead3').stop().animate({backgroundPosition: '0 -143px'}, {duration:300}); jQuery('#masthead1').stop().animate({backgroundPosition: '0 -143px'}, {duration:300}); },
Hi I would like to make my $.Ajax to load a page like the browser does, part by part, not only when the page is done to trigger.
Hi I would like to make my $.Ajax to load a page like the browser does, part by part, not only when the page is done to trigger. See this is my problem, MY JQuery $.load loads a page of Search.php with the params that the user inputted via Javascript, but the content is only shown after the page is completely done. For example, in the browser you can get the part that is already loaded, not only when is entirely done, How Do I do this with Jquery.Load ex: $("#content").load("search.php"); // I wish
Need help with loading external html file into run-time div.
I have one html file with a "rialtoImg" image and "dummylink" link. When I click on the link I want to load another html into a run-time constructed div and move existing image into this new div. My two questions are: Why loading of anotherRialto.html does not produce results(i.e image anotherRialto.jpg is not visible)? Why html() property is empty in the first element of #imageDiv and "id" is equal to imageDiv? I They are also embedded in my js code shown below. Entire test project is also attached
How can i get the "title"'s value?
<select id="developer"> <option value="0">Select Developer</option> <option title="Todd" value="1">Todd Sharp</option> <option title="Brian" value="2">Brian Meloche</option> <option title="Ray Second" value="3">Ray Camden</option> </select> I can get the selected choice's value with below. var deger=$('select[name=developer]:selected').val(); But how can i get the "title"'s value?
Load html containing divs and flash movie embedded into another div tag with .load()
Hy there, I am pretty new to jQuery, what I try to achieve is giving my files a bit of a structure. Therefore I want several HTML files containing each a scrollable (jQuery Tools) which should contain some flash movies to slide through. I can load plain HTML with the .load() function into a div, but as soon as there are divs in the HTML to insert, it won't work. Should this work ? Thank you, maxx
Deactivating the "hover" state of a hyperlink.
I have some code which moves an element from one position in the document to another, when a link is clicked. The link itself is moved as well. The CSS makes the link's background change colour when hovering. This problem is only occurring in IE6/7/8, which is that, when the element (containing the hyperlink which was clicked) is moved, the "hover" state of the link remains "on", that is the background colour remains, even though the link is now somewhere else on the page and no longer under the
Simple switchClass Question
I have many images that I wish to have the class switched when they are clicked. Since there are many I do not want to write the function for each image. I am trying to write a function to take a class as an input and switch that class to another, but so far it isn't working. Anyone know where I'm messing up? $(document).ready(function() { $(".bubble1").click(bubbleDown("bubble1")); $(".bubble2").click(bubbleDown("bubble2")); $(".bubble3").click(bubbleDown("bubble3")); $(".bubble4").click(bubbleDown("bubble4"));
Nested jQuery Selector Context?
Hey there, I am using jQuery in a Firefox add-on. So I have to use the jQuery selector context to access the contentDocument: var elems = jQuery(".selectors", doc); (doc = gBrowser.selectedBrowser.contentDocument) [Mozilla-specific] That context is accessing the entire website markup, of course. But I'd like to specify the context even further. Is that possible? Something like var elems = jQuery(".selectors", jQuery('#selector', doc ));Or would there be a better way? Regards, Oliver ----------------------------------------------------
Problem counting elements in div - need advise.
I have a test scenario which consists of one "main.html" file with one image and one link in it. When I click on the link I am loading anotherRialto.html file into main.html. "anotherRialto.html" has just one image in it. Lastly I am counting number of images in the main.html file. I have some issues with my implementation of this scenario and will really appreciate your help. All files (main.html, anotherRealto.html, two image files of Venetian Rialto bridge and testCounter.js) needed to run
How to output source HTML of selected elements?
I'm wondering if there's a jQuery method or plugin which allows me to dump the HTML source of all selected elements, ie. the element(s) referred to by any jQuery object? As opposed to .html(), which outputs the "innerHTML", I'm looking for something like IE's old "outerHTML" function, which also provided the tag's own code as well as its inner HTML. For a jQuery object which has captured several elements, I'd like to output *all* the HTML of all those elements at once, in one "dump" as it were. Is
How many users disable javascript?
I'm moving from fully Flash sites to AJAX with jQuery etc. I see that handling the situation where the user has javascript disabled is given a lot of emphasis in books and tutorials on jQuery. Is it really that important? After all, if you've disabled javascript shouldn't you accept a limited result? Accessibility seems a valid reason, but how many screen readers can't handle javascript? Mobile and other devices that can't handle it are only a concern if your site is one that's likely to be of interest
Is there are function to see if two elements are the same object?
I have a function which takes a jQuery element as a parameter, and I want to test it against a list of elements to see which one it is. None of the elements necessarily have an ID. For example: if($obj1 == $obj2) - will that return true if the jquery objects refer to the same element? Or is there a recommended jQuery method to use for this?
Jquery newbee - confusing problem?
Hello to all, it`s nice to be part of JQ community, even for a total beginner, some great and helpful stuff I`ve found here! This is probably stupid question, It`s a matter of validation form plug in. This is code from my html : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>My Title</title> <script src="jq/js/jquery-latest.js"></script> <script type="text/javascript" src="jq/js/jquery.validate.js"></script> <meta http-equiv="content-type"
How should i translate this code?
Sorry I'm new with jQuery, but before I used Mootools. So I thought to translate my web site in jQuery (it is in Mootools, but I guess that jQuery is better). How could I translate this Mootools ? http://paste.ideaslabs.com/show/FKmNbLJeiE Thanks a lot! :)
How come there's submit handler, but no reset handler?
In the jQuery API, there is a .submit() method to deal with submit events on forms. However, I want something like that except for reset events. But there is no .reset() method.
HELP: get val
How do I get if class status is OpenStatus then Alert? sometime maybe is class status is not OpenStatus, then do Nothing... <table> <tr> <td class="firstrow newrow">...</td> <td class="status">OpenStatus</td> </tr> </table> Thanks~~~
I am looing for feature like scrollTo
Is is some thing possible like I can Scroll window automatically. scrollTo(ElementName); Please advise, If possible with jQuery. Thanks in advanced --------------------------------------------------- Get Funny Images which force you to tell WOW!!
HTML Form Radio Elements Not Serializing (IE7/8/+)
I have an Ajax form that contains radio buttons. On Chrome and Firefox it submits fine and the back end has all the info on the form, including the radio button info. On IE 7/8/+ all info EXCEPT the radio button information is posted to the server. Is there a known issue with radios and serializing in jQuery? I'm using 1.4.2 Anyone run into this before and have a quick tip to share?
set the value outisde the parent..
I have list of department id with view link (dislpaying in table1 and hiding table 2). If view link clicked, using toggle.. i can able to hide table1 and display the new table say table 2. i need to set the value of selected departmentid in table 2 ? how to do it in simple way...?
Basic JQuery Use Question
I am starting to use JQuery and need some basic help — probably a quick solve. The layout is at http://stage.redcellar.com and I have it set up so that when you roll your mouse over the menu bar, it fades to color and then slowly fades out when you are focused more on the content of the page. The only problem is that when I add the div that contains the menu items to a z-index above the image (which uses z-index to change) the image will fade back out when the mouse enters the menuitems div. You
using replaceWith() with conditions
Hi everyone, I've been using jQuery for a while now but I never needed to write something from scratch up until now. Is it possible to use some if statements to replace (replaceWith()) a form depending on which of the inputs was activated? The objective is to design a quick survey tool with different forthcoming questions, depending on the ones given.
jQuerys $()
Hallo, ich arbeite seit ein paar Wochen mit jQuery und bin auf eine Abfrage gestoßen, die mir nicht ganz klar ist, Und zwar: $('div', $(this).parents('div:first')).css('display', checked ? 'block' : 'none'); Die Abfrage mit einem Parameter (z.B.: $('*')) sind mir klar aber $() mit 2 Parametern ist mir nicht klar, Könnte mir vielleicht jemand die obige Abfrage kurz erklären? Vielen Dank!! lg
$.ajax get an element Content like load does $("body").load("link.php #DIV_THAT_I_WANT" ...
How do I get the element content like load does $("body").load("link.php #container"); and then he would get the "container" content and he would place in the body element of the page, but Now I need some other options that $.ajax has but I can't make it work, how do I do that using $.ajax? Another thing in this example below: $("body").load("link.php #container", function(data){ alert(data); }); He would get the "container" div content and place in body, but when he alerts the data, its
File upload
Hey guys, I have a form that uploads a file along with posts some other information. I would like this to happen without having to reload the page, but I am unsure how to do this in regards to the file upload. I read that it is only possible with some plugins, but I would like to hear your recommendations before messing around with it too much. Here is the relevant parts of my code: submit.php <form method="post" id="submitContentForm" action="./php/submitContent.php" enctype="multipart/form-data">
code working only in FF and Opera
every other browser fails. there's got to be a simple explanation for this. code: $(document).ready(function() { $('.next').click(function() { nextSlide(); return false }); $('.back').click(function() { prevSlide(); return false }); setInterval ( 'nextSlide()' , 9000 // duration ); }); function nextSlide() { //alert('"NEXT" called'); // get the current 'left' position of the div oPosition = $('.items').css('left'); // strip the 'px' off of
Next Page