unselected checkbox
hi, now i get value if i selected checkbox(id which was selected), but how get value when i unselected (id which was unselected)? For example I push on 1, and i get value 1. When I unselect 1, i get value 1. I hope you understand my problem. <script> $(document).ready(function() { $("input[type=checkbox]").change(function(event){ $("#result").html("&id=" + this.value); }); }); </script> </head> <body>
jquery is undefined?
In IE I get the following error 'jquery is undefined'. I can not find any consistency that may be causing the error. In FireFox a blank alert box just comes up with no related javascript error and any jquery methods just stop working. I'm assuming it's the same error. I restart the browser and the error is gone. It always comes back. Any suggestions as to a possible solution, a way to track it down or what may be causing the error would be greatly appreciated. Thanks, ~Donavon
using .load for loading pages via AJAX, how to set callback within LOADED page.
Hi, I'm using $('#container').load method to handle loading all the subpages of my site. Now the deal is, some sub-pages require extra behavior (like form validation etc.) I'd love them to be self-contained, so - each sub-page has own JS code that handles all the subpage-specific tasks. This however requires some of them to handle "loaded" callback to access the just-loaded DOM nodes. Any tips on how to achieve it? I tried putting <form id="my-form"> .. </form> <script> $('#my-form').ready(function()
jQuery UI Demo does not work with Chrome
Hi, The Demo in Chrome 6.0.472.25 dev renders all the examples inoperable. It works in Firefox and Explorer with this url to my hard drive. file:///C:/jquery/development/demos/index.html#draggable|default But in Chrome no luck. See the attached screen capture "ChromeProblem.jpg. I tried to solve this months ago, and I discovered downlevel versions of Chrome worked. Which one?? I don't remember, but after upgrading Chrome the jQuery UI Demo always stopped working. I tried many different machines,
Help with window.load functions.
I need help with combining an image resize script and a fade in script. Basically I would like the image resize function to happen before the fade in. Here's the code I'm using now. jQuery(document).ready(function($) { var $img = $("#pics img"); var ratio; var offsetX = $img.offset().left; var offsetY = $img.offset().top; $(window).load(function () { ratio = $img.width() / $img.height(); $(this).resize(); }); $(window).resize(function () { var viewportWidth = window.innerWidth || document.documentElement.clientWidth;
Getting data from object returned in jquery, ajax call
Hi guys, having a problem with an ajax call, hope you can help . I call a query, get success, but don't know how to get the data out. Here is the code.. $.ajax({ type: "POST", url: "index.cfm", data: "fuseaction=timetable.GetMyData&MyValue="+MyValue, success: function(MyValue){ alert("MyValue is " + MyValue);
How to put an icon in the left top corner of titlebar
Hi, Could you help me with the idea how to put some icon in the left corner of title bar, just before the title? Thanks
Using Delay() with Hide() at onMouseOut call
I am putting together a simple bubble tooltip that I want to delay the hiding of so that the user can click on the href link created in the bubble if they want to. The script is called like this; <img src="images/dscf0225.jpg" alt="" width="160" height="120" style="border: none" onmouseout="$('#bubble_tooltip').delay(2000).hide(10);" onmouseover="showme('Click the image to visit <a href=www.yahoo.com>Yahoo</a>', this);"/> Everything works fine when there is only one instance of the call on a page.
Getting id
As opposed to the usual syntax to get an id node from the current document: var div= $("#myid"); I need to do the same for xml stored in a string returned from a function (see "data" below). The id I'm trying to grab is "sliderdata" and I want to do something like this (I know the syntax on line 2 is wrong, but how is it done correctly? $.get("http://localhost/myfunction", function(data){ var newdata = $(data).find('sliderdata'); // how do I traverse to id = "sliderdata" on string data?
setting non-jQuery object property inside each?
Trying to add a new property to a non-jQuery object from inside each loop doesn't appear to work: var arguments=new Object(); arguments['ticket']=ticket; arguments['email']=email; arguments['module']=module; arguments['epoch']=new Date().getTime(); var total=0; $('select.category').each(function(){ var name=$(this).attr('id'); var option=$(this).find('option:selected').val(); total+=parseInt(option); arguments[name]=option; }); The
Animation and images
<!-- html code --> <div style="text-align:center; border: solid 1px Orange;"> <div style="margin: 0 auto; border: solid 1px Green;"> <img id="mainImg1" style="position: relative; left: 0px; width: 355px; height: 200px; border: solid 1px Red; display: inline; vertical-align: bottom;" src="Images/Landscape1.jpg" title="Featured Image in Gallery" alt="Featured Image in Gallery" /> <img id="mainImg2" style="position: relative; left: 0px; width: 355px; height: 200px; border:
Form submit (non ajax) only certain form fields?
Trying to find out if it is possible to submit a form (not ajax submit) and only submit certain form fields. I know it is possible with an ajax submit like: var post_data = $("SELECTION").serialize(); $.ajax({ type : 'POST', url : 'script/post.php', data : post_data, dataType : "text", success: successfunction }); Now is it possible with a regular form submit in jquery?
help with ajax array issue - ie only
Hi Guys, I am currently trying to add some checked values to an array to eventually store in a db table. So I am using ajax .load function but having problems in IE. Basically, in IE only the first check box can be added to the array, the following checkboxes with the same id / name wont add. Works fine in firefox. I am using the codeigniter framework. Any ideas? Heres the script.... <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script
How to set disabled if control has a value
I want to set all date fields to disabled if they have a value. All fields share a common class - 'datefield'. I am a newbie and appreciate any help. Thanks, Bill
Screen Scraper in jquery?
Hi, I'm building a website regarding hurricanes, and I need a way to extract the text in the NHC's Tropical Weather outlook (http://www.nhc.noaa.gov/gtwo_atl.shtml) and then have it pasted into my website. I have only limited knowledge of javascript, but I am proficient in HTML & CSS. Any help is appreciated, Luke.
What's the best approach to build a site like this one?
i like this site: Grip Limited (the navigation idea... ) It's built in Flash. I was wondering how to build this kind of site without Flash and using Jquery. I thought of a big container div without scrollbars and overflow hidden (so no scrollbars will be visible). The content of this div should be x-scrollable by dragging the mouse. The content of this div is each of the columns that load its content via ajax and expands right when ready... each column must be y-scrollable by dragging the mouse
want to choose the css selector "clicked"
hello. I have a question about choosing a css selector. As partially shown below, an user clicks a dom element "dl dt", then the code executes whatever inside. in the HTML, there is an element <dl> <dt>...</dt> <dd> <div id="">...</div> </dd> <dt>...</dt> <dd> <div id="">...</div> </dd> ... </dl> then, by clicking "dl dt", the element works fine. But I want as well to change the attribute of the div element, which is a child of <dl> and is a sibling of <dt> . How should I set
reset variables on page refresh
Hi, when reloading a page containing some jquery code based variables (which are: a variety of datepickers with set dates, and a number of form textfields containing calculated and formatted monetary values) it appears that those variables remain set. If I set a variable on the page (in a form field) then refresh the page I would like for everything to be cleared out (start with a clean slate). I work around this by setting standard values to all those fields and datepickers manually, but I would
Selectors, variable assignment and strange behavior?
I am stumped here, when using a selector's name attribute, perform a x.replace() on the variable, then attempting to get the new name of the attribute I am getting the original selector's name. $j('input[name*=\\[txtProductQuantity\\]]').bind('blur', function() { if ($j(this).val()) { var x = $j(this).attr('id').replace('txtProductQuantity','txtProductPrice'); alert(x+' => '+$j('input[name^='+x+']').attr('name')); } });
append only to one div
I want to change a description (caption) of image after click on it... click(function() { var title = $(this).attr('title'); $('.description').html(''); $('.description').append(title); });and it's working but it's adding the same description for all galleries in all my posts, it should change description only in this post. Another explanation of my problem: In each post I have a gallery with
Problems with accordion based on slideToogle() and slideUp()
Hey everybody, at first let me say hello to everybody cause i am new in this forum. I am still using jquery a while but wouldn't rate my jquery knowledge very good. Actually i am trying to build an accordion based on slideToogle() and slideUp()... The only problem atm is that opened <ul class="children">...</ul> wrappers(yes they are the tooglin elements...) doesn't get closed, i think i missunderstud .siblings() and the hierarchy...? I have the following structure: Rendered HTML <div id="wrapper">
fadeIn / fadeOut performance problem
I am working on a solution which just fades in and out between different images. Since the solution needs to be dynamic (the images are scaled according to the window size), I am running in to problems. Whenever the images measurements are modified on window scaling by javascript, the fades are starting to jump/flicker, not running smoothly at all. jQuery is used to edit CSS properties (width/height) of the images. Also tried to edit img tag width and height attributes instead of CSS, but the problem
IE7 .show() - .hide() problems
Hi, I'm working on a website with some simple jquery effect to show and hide multiple div at the same time. Clicking on a thumbnail with specific title attribute, I want to show corresponding div. The page works fine in IE8 (animations are not so fluid), firefox 3.6, chrome 5.x. You can view the page here: http://emilione.altervista.org/works.html How to reproduce the problem: -click on (x) thumb: content div appear -click on (x) thumb: content disappear -click on (y) thumb: (y), (x) and often other
Shift-Click Selection Problem
Tested this in Safar, Firefox, Chrome and IE8. All exhibit same issue. I have a list of several dozen elements. I shift clicked the first and third element. Elements 1 through 3 are selected as expected. I shift clicked the 6th element and get elements 3 through 6 selected, with items 1 and 2 no longer selected. Quite annoying as you can imagine. Is there anyway around this? The elements are being selected with .children('.ui-selected') Thanks! :D
From mootools to jquery (rewrite function)
Is there anybody who can convert my function to jquery? It's a short function but I won't handle it by myself. Thank you. window.addEvent('domready', function() { $$('.post > .post-body').each(function(el) { var ii = 0; el.getElements('img').each(function(il) { if(il.offsetWidth > 100 && $(il).get('src')) { ii++; } }); if(ii > 2) { var ul = new Element('ul',
Safari and Chrome .hide .show issue
I have been searching for an answer for this for most of the day and can't find anything relevant to what I have going on and am hoping someone here can point me in the right direction. The problem is a light box I built, when you click on an image the large image shows up in a light box along with a close link. Works fine in everything except Safari and Chrome. The image shows up the first time you click on the smaller one but subsequent clicks get an empty light box. Here's the code: function ChangeLightBoxImage(image_num,
Lightbox to fade desired div
Hello, Is it possible to fade only a desired portion when using a lightbox? For eg: can i simply fade a single td in a table instead of the entire page? Thanks
Reorder Children
I have a div with some paragraphs in it. I would like to reverse the order of those paragraphs. Possible?
jquery reports XML parseerror when using IE on local xml file
I've asked about this before but have more facts and a more detailed example. I've written an html file that uses $.ajax to fetch an xml file (and specifies dataType "xml"). Under firefox it works perfectly, whether the html and xml files are remote (http url) or local (file: url). Under IE, if the files are remote, everything is fine. Butif the files are local, then although the fetch is successful, jquery's internal httpData method fails to parse the xml, and instead invokes the $ajax call's
Fetching file:// urls
I'm using the .ajax() method to fetch a url that is usually http: (where it works fine on all platforms) but is sometimes a file: url that is fetched just fine in firefox but fails to fetch under IE. Should this behavior differ on the two platforms? Is there a proper way to fetch a url that works for both http: and file: urls on all platforms?
Help with Mootools Migration to jQuery!
Hello everyone, Someone could help me convert the following code to jQuery Mootools. Please I would be very grateful indeed. Thanks in advance. window.addEvent("load", function(){ Fx.Opacity = Fx.Style.extend({ initialize : function(el,options){ this.now = 1; this.parent(el, 'opacity', options); }, toggle : function(){ return (this.now > 0) ? this.start(1, 0) : this.start(0, 1); }, show : function(){ return this.set(1); }
jQuery removes <title> tag when parsing XML
For the life of me i cannot figure this one out, i have the following XML data <?xml version="1.0" encoding="UTF-8"?> <deal> <title>adasd</title> <cost>3</cost> </deal> when i try to parse with using jQuery i get the following result > $(data).html() = <cost>3</cost> What is happening to the <title> element? How can i get that data?
Scrolling view with a slideToggle()
I'm using a slideToggle() to show or hide a div in the bottom of my page. When the div is shown the view don't "follow" the div that is appearing. How can i make the view sliding down with the div that is appearing? Thank to all.
Dynamic Element help
I am a total newbe here, so I apologize in advance. I have a sliding catalog which uses dynamically generated page numbers to scroll through the pages. Each page utilizes an image map to hover over the item to view more info. All is working well, with one exception. When I click from the cover to page 1, onclick: I'm appending page 1s <li> into the <ul> and am generating the <map><area...></area></map> (via Ajax) and placing via .innerHTML. The hover effect works as expected. When I continue to step
Question about auto populating a form
I am working on updating some internal web based applications. I am doing some slick stuff in jQuery like directory listings and using Flexigrid. I am running into a brick wall though with one specific problem. We have a form that is filled out and then a price quote is returned to the user. Not that complicated, but. the form that they fill out is dynamic. for example, the form starts out with one div that gets filled out. As the user requires more information to be input they basically spawn a
Parent selector
I am trying to figure out if it is possible to select elements on a page where the element itself OR a parent element (at any level) has a certain class. Explained in more detail: Base function: $(SELECTOR).each(function() { Do something; }); Example html: <ul> <li>A</li> <li class="y">B <ul id="1"> <li id="2">1</li> <li id="3">2</li> <li id="4">3</li> </ul> </li> <li id="5" class="y">C</li> </ul> The selector would search for
IE7 + HTML5 + jQuery Selector
Honestly, I'm not sure if this pertains specifically to jQuery or not. I've got a simple test page that has an <input type="color" ...> element on it, using the mColorPicker plugin. My JS is as so: if ($("input[type='color']").length) { $.getScript("assets/js/mColorPicker/mColorPicker.js"); }The problem is, the input[type='color'] selector is not returning any elements in IE7, so $.getScript is never fired. I've got a theory as to why this is happening, but would like to hear your ideas. P.S.
Can't get .get() or .post() to load next page.
So what I thought was going to be really turns out to not be working for some reason. I'm setting up a shell for my new site. So I'm just trying to get some of my pages linked together for testing the site flow and feel. I want to do this with javascript (jquery) because when I start passing session data that's how I'll be handling this. So I have this simple line in my js code... $('#submit').click(function(){ $.post("plans.html"); }); When I debug it hits the $.post but the plans.html
JS Error in IE8, null or not an object
getting the error "'img' is null or not an object". loc_json.places is as you guessed JSON. Works fine in Firefox, Chrome, & Safari. Breaks at error in IE8. Any ideas? I've been debugging this for days. $.each(loc_json.places, function(i, item){ if(i==(totalPlaces - 1)) { lastClass = ' last'; } //console.log(item.img); markersHtml[i] = '<div class="item' + lastClass + ' item-'+i+'"><img src="' + item.img + '" alt="" /><a href="#" class="map" rel="' + i + '">'
Help... I don´t know where is the error (very simple, i think!)
Dear friends. I´m speaking from Brazil, and I´m trying click in a ckeckbox and a text appear into a textarea using php getting the data from mysql, but I don´t know where the error is. Here is the code. <script type="text/javascript" src="jquery-1.4.1.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("select[name=msgs]").change(function(){ $.post("texto_msgs.php", {msgs:$("#msgs option:selected").text()}, function(valor){
Next Page