Function with multiple parameters as argument in setTimeout
Hi. I have written the following code (quite meaningless. Just to check why setTimeout is not working in a similar real-life code) to enable the user to input a given time interval (hh:mm:ss) when a p is clicked, and then alerting the user with the time entered in the seconds portion one second after the div is clicked. But it is not working. I think the setTimeout is the culprit, the way I am passing parameters to the function inside it, but don't know where exactly am I erring. Can anyone help?
jQuery a:hover color
Hello, I have an anchor tag, whose css is defined as follows. a:hover { color:#D26833; } So, my question is how can we get hover color of anchor tag using jQuery ?
Styleswitcher and re-assessing the height of a dom element afterwards.... Resolved
Hi, I've got some style switching code for large text / high contrast. After applying this new style sheet, I want to recalculate the height of an object based on it's content. I don't want to fix this content's height as it is managed by cms and changes regularly. The problem is that after the text is enlarged and the element (.column-content) increases in height, I am still returned the old height i.e. although the new css is applied on the screen, my jQuery is not returning the new height. I suppose
Save As dialog box.
I know this is more of a plain old Javascripting question, but I'm going to ask it here as well. What I'm trying to do is have a 'Save As' dialog box pop up when I click an anchor tag. What's hidden in the anchor tag is base64 information, so my anchors look like this: <a href=# src='data:application/octet-stream;base64, (base64 string)'>file name</a> So when I click on this, it gives me the option of downloading my base64 info just fine, but the problem is, the name of it looks to be just the entire
change a div height with smooth effect
Hello, I have to change a div height, when I click a button. At the moment, I use this code : $('#map-trigger').click(function() { if( $('#map-container').hasClass('closed') ) { $('#map-container').css('height', '581px'); } else { $('#map-container').css('height', '294px'); } });This works. But the height is "instantly" updated. I'd like this effect to be smoother : The height should "slide" from 294px to 581px. Is that possible ?
IE help?
Hi I wrote the following code to check some field values and it works fine in Chrome and Firefox, but doesnt work at all in IE, does anyone have any idea why? Code: <html> <head> <script src="http://www.rasclerhys.com/jquery.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function(){ $("p").hide(); $("hiden").hide(); $("help").click(function(){ $("p").slideDown("slow"); $("help").hide(); $("hiden").show(); }); $("hiden").click(function(){ $("p").slideUp("slow"); $("help").show();
Bug in jQuery / jQuery UI
Hi, first of all, sorry for my bad english, I'm from Germany. I have a problem with jQuery, the first, but it is a big one. But the bigger problem is, that my Firefox and my Chorme developer tools don't throw an error. The situation: I have a site with jqGrid, if click on a row, than it opened a jQuery modal dialog, here I use jQuery UI Tabs and so on, no problems, but there is a "Answer" link in that dialog, if I click on that a second modal dialog opens with two multiselect jQuery controls and
Page + Mouse loading animation
I have a webpage that calls a PHP script through AJAX, and the PHP script loops infinitely until it detects a change in the database, polling every second. The front page that uses the AJAX call shows the page forever loading because the PHP script in the background is always running, is there any way to stop the loading / "Waiting for localhost..." from appearing? It's really annoying.
Correct Improper HTML with jQuery
I'm developing a site in Wordpress for clients who have ZERO html skills. One of the problems which has cropped up a couple of times, is that they have somehow managed to insert improper, unlabeled/empty DIV tags into the post content, and it's not surprisingly breaking the site's page formatting. I have searched far and wide, and utilized quite a bit of trial and error to find a way for jQuery to solve this problem for me, but I'm as yet only partially there. Assume this sample HTML: <div id="the_content">
No fade on SwitchClass
Thanks for taking the time to read my question. I am using $("#BlueBoxsm").hover(function(){ //Change BlueBox1 $( ".BlueBox1" ).switchClass( "BlueBox1", "BlueBox1Hover"); etc..... to switch a class on a <div>. By default it seems that jquery wants to smooth out this transition. The transition, however is not that great, so I'm wondering, is it possible to turn this off? Thanks, Brad
What exactly is this code doing?
<script type="text/javascript"> $(document).ready(function() { $("*").each(function(e) { this.style.color = this.nodeName; }); }); </script>Basically, when it identifies stuff like <red>Test</red> and the output would be the color red. I am trying to create custom html tags, so that people can type <pink>My test</pink> and their text would come out pink! Its a neat idea, but there are two problems: I don't understand how this code works (it makes no sense to me and i was hoping someone could
Sorting Columns w/jQuery?
Hi, I have a list of records from my database being displayed on this page. I want to be able to sort the columns. Typically, I do this with an HTML table, but was wondering if there is a way I can setup the below code using jQuery to allow for the column headers to be sortable? I have an icon to sort up and an icon to sort down. My goal is to allow the user to sort the data without a page refresh. <div class="header"> <ul> <li style="width: 20%;">Customer Number <img src="images/iconSort.gif"
jquery mask query . . .
I am trying to use the jQuery mask to allow hyphenated names in the string . . . for example : smith-jones can anyone help ? cheers mick
Image resize issue in Safari
I have the following code which I've changed a million times trying to find the "right" trick but it still doesn't work in Safari. All attempts have worked in Firefox. All I'm trying to do is dynamically build a div from a query to display a series of images. My header has zoom in/out buttons which should resize each image in the div. Safari works only AFTER I resize the browser window just a nudge. Once I do that one time, the zoom function works great. Why does Safari need this browser resize
Show Slide help for newbie
Hi All, I am trying to get floorplans that are initially set to display:none to reveal with a slide down using the slide ui of jquery. Here's the jquery: <script type="text/javascript" src="assets/jquery-1.5.min.js"></script> <script type="text/javascript" src="assets/jquery-ui-1.8.9.custom.min.js"></script> <script type="text/javascript"> $(function($){ $('#groundreveal').click(function(){ $('#secondwrap').hide(); $('#groundwrap').show("slide", { direction: "down" }, 600); return false;
Add / Change / Delete Records Style Interface
I would like to make an interface that lets the user add, change and delete records in a database. My idea is to show a data grid of the current records, and next to each record have a "Change" and "Delete" button. At the bottom of the datagrid would be a form containing empty text boxes that can be used to add a new record. I figure that if I make everything work via AJAX then it would make the interface very much like a typical Windows application, with no page refreshing needed. The user would
jQuery cycle images show on second load.
Hi, I'm currently using jQuery Cycle slideshow to preview images on my site. However, recently some pages require to be loaded a second time - or the link clicked twice - before the slideshow or images will show. For example; http://ianep.co.uk/kred It happens on most pages off the 'Work' page or image thumbnails, bar a couple. I don't have a knowledge of Java to know what to change, and as far as I remember, haven't changed anything. The HTML for the image links that work and don't work are the
When using the queue setting in jQuery.animate, are callbacks disabled?
I am having a problem getting my callbacks to fire when I use the queue option and wondered if this was normal. $("#someid").animate(cssopts, {duration:3000, queue:false},"easeOutExpo",function () {alert ("hello");}); does not callback, however this does: $("#someid").animate(cssopts,3000,"easeOutExpo",function () {alert ("hello");}); What am I doing wrong? Thanks in advance for your help. Jase
What is the expected behavior of ifModified:true ?? v1.5
This sounds simple (just try it, right?) but this is becoming rather confusing because there is no documentation explaining how ifModified is designed to work. Also, I've seen postings on various sites saying that the ifModified is broken, blah, blah, yet a lot of them seem to be due to a misunderstanding of how it is supposed to work. For several days a couple of weeks ago I was able to use ifModified:true and it would convert the 304 response code to a 200 and it would respond with data from the
Charset problem
im having a problem with the charset, when i set the page to UTF-8 the table head and foot accent marks become strange chars but if i set to ISO-8859-1 the text inside the table and on other field become this strange chars.. screenshots UTF-8 http://img262.imageshack.us/img262/9178/utf8.jpg ISO-8859-1 http://img705.imageshack.us/img705/4682/iso88591.jpg I use .post to run a php page that inserts the values to a sqlite file. Im building the table using php echos and datatables. Does the post method
loop through JSON with .getJSON and $.each
Hi jQuery folks First question - how you debug in Jquery, i am getting crazy because firebug doesn't give me a response on code lines... I am trying to get the latitude and longitude from a json structure which i got over this google maps geoencode api (v3) - 2 addresses -> it looks like this.... [{"status":"OK","results":[{"types":["street_address"],"formatted_address":"Moserhofgasse 36, 8010 Graz, Austria","address_components":[{"long_name":"36","short_name":"36","types":["street_number"]},{"long_name":"Moserhofgasse","short_name":"Moserhofgasse","types":["route"]},{"long_name":"Jakomini","short_name":"Jakomini","types":["sublocality","political"]},{"long_name":"Graz","short_name":"Graz","types":["locality","political"]},{"long_name":"Graz","short_name":"Graz","types":["administrative_area_level_2","political"]},{"long_name":"Steiermark","short_name":"Stmk.","types":["administrative_area_level_1","political"]},{"long_name":"Austria","short_name":"AT","types":["country","political"]},{"long_name":"8010","short_name":"8010","types":["postal_code"]}],"geometry":{"location":{"lat":47.0609404,"lng":15.4545919},"location_type":"ROOFTOP","viewport":{"southwest":{"lat":47.0577928,"lng":15.4514443},"northeast":{"lat":47.064088,"lng":15.4577395}}}}]},{"status":"OK","results":[{"types":["locality","political"],"formatted_address":"Hermosa,
DOM weirdness after a jquery.load() help!
I'm convinced i never had this problem < 1.4 jquery, but i've tried 1.4, 1.4.1 and 1.5 too. I have an area of my page that i load new html content in. i have an input field that has an autocomplete bound to it. I'm aware that if i load html content then the event bindings do not work as the elements being loaded have not been bound, they need to be rebound to the elements. I'm aware of 'live' as well but in this case i'm using an instance of autocomplete which internally binds to the keyup events.
Draggable background with jquery?
I'd like to make it possible to move the background of a site by clicking and dragging it with the mouse. So far I've only found flash solutions and I'd really rather not use flash. If anyone knows of any jquery code that is somewhat similar that I could possibly adapt I'd appreciate being pointed in the right direction. Thanks!
Creating basic menu
Hi, I'm new to jquery and I find difficult to get working a menu. I have and ul like: <div id="left"> <div id="menu"> <div class="inside"> <ul> <li><a href="#1" title="One">1</a></li> <li><a href="#b" title="Two">2</a></li> <li><a href="#3" title="Three">3</a></li> <li><a href="#4" title="Four">4</a></li> <li><a href="#5" title="Five">5</a></li> </ul> </div>
How to call a session variable in JQuery
Hello Group, I am trying to reference a session variable inside some JQuery code. These examples below are what I am using currently just to try and see if I can get something to display and nothing shows up. See anything wrong? alert(Session("OwnerIndicator").val); alert(Session("OwnerIndicator")); Just to make sure an alert works, I threw in a alert("hi"); which works fine. It is when I try to write out the session variable it fails. Thanks in advance folks... Lee
search children recursively
Hi All, This seems like it should be really simple, but it has escaped me. I have a jquery object and I want to start there and search ALL of it's children recursively using a selector. EG. $(this).parent().parent().children('.targetClass').each(..... My problem appears to be that .children only searches the immediate children, not the entire subtree under the node. any advice? Thanks, Dan
Malsup Cycle plugin: pager disappears when new element added
I have been running the cycle plugin with success for a while, using 3 images, a caption, and a pager area (simple dots). I just added a fourth image/caption. the pager picks up the fourth image, adding a dot. However, it now fades in on transition, then immediately out. no other code changed other than the addition of a fourth image. Any ideas why this is now malfunctioning? See page at: http://unitedway-pdx.org Thanks, Maria
Dynamic Content
I have a file that contains a list of contacts. Each alphabet letter has its own div with last names that start with that letter. Like this: Filename is AJAX.htm <div id="A"> Anderson<br> Alliance<br> </div> <div id="B"> Bendover<br> Banson<br> </div> When a user clicks on the appropriate letter I want to pull in just the appropriate div info into the existing page. So, they would click on one of these two buttons: <a href="#" onclick="showContent('A')">A</a> <a href="#" onclick="showContent('B')">B</a>
Posting each input
Hi, im trying to post each input element in my form. The elements are generated with a click function. So if there are 2 elements i want to post the values of both to a php script. This is what ive tried so far but it doesnt appear to work. jQuery('#upload_form').submit(function() { var list = jQuery('input[id^="uploaded_file_name"]').length; jQuery.post('process.php', { for(var i=0; i<list; i++) { files:jQuery('#uploaded_file_name_'+i).val()
Getting info out of SOAP.
Dear people, I'm using an web service to retrieve information from it. I got an working plugin from here and when i push a simple button I get the information in a string. But, now i need certain things to be shown but can't find the way how. So when i got an success function(data) i want to retrieve the info from (data). When i try some ajax coding like: var strInfo = $(this).find("Code").Text(); When i alert the content in a string, i get absolutely nothing! Can someone help me?
How to implement Toggle without using Toggle function
Hey all -- I'm extremely new to jquery and trying to write a toggle function without using the built-in functionality. From what I've read, this should be a fairly straightforward exercise. However, I'm running an issue. My code doesn't seem to do anything. Not clear to me why because nothing is erroring out? Here's what I've got: <html> <head> <script type="text/javascript"
removeClass() - tag still thinks it has class
In the following code, clicking on a span with class "qwe" will alert a message. If you then click the first span to remove "qwe" from the other spans, the alert still shows when you click the old "qwe" spans. It's like the spans still think they have the class "qwe". Once a "qwe" always a "qwe"? I've obviously made a mistake but don't understand why. Any suggestions? $(document).ready(function(){ $(".a").click(function(){ $(".b").removeClass("qwe");
Any ideas why jQuery fails when loaded into div externally?
Greetings, I'm having an issue which on a broader scope, seems to simply be that jQuery stops working once code is loaded from an external source into a pre-existing page's div element. Is there something I'm missing as this seems pretty straight forward but the only thing I can see in Firebug is there may be a cache issue as a page loaded WITH the code in it contains more cache elements (assuming the missing elements) then the same code placed into a div element. Greater detail is here: http://forum.jquery.com/topic/jquery-animate-fails-when-code-is-piped-in-from-separate-file
Simple code add on, I hope!
Needless to say, I am no coder! I dabble with it only when I have to. I have images/text linked to buttons that fade in “onclick” from “original” images/text . I’ve gotten this to work great with text or image but… I would like the images/text to fade out and return to “original” images/text after a time limit and or no mouse use. Here’s the code I have so far: $(document).ready(function(){ $('.image/text1).click(function() { $('#original_image/text).fadeOut(300,
Ajax from child domain
Hi all, I need to make a XHR from a child domain, for instance child.api.com -> api.com. Normally that can be done by setting the document.domain attribute to the same base domain (api.com) $.ajax({ url: url, data: [], beforeSend: function(jqXHR,settings){ document.domain = 'api.com'; console.log('before send:' + document.domain); }, success: function(resp){ console.log('success!');
Image load when dom is ready
Hi, Im trying to get the 1st image in a carousel to be inserted into a dom element on page load. Clicking the carousel images in turn, does load each image into the dom element in question. However, need to get the 1s image in the crousel to load without having to click it. Webpage: http://www.codesolv.net/play02/ //Failed Attempt to load image on page load var $enlargedCover = $('<img/>') .addClass('enlarged') //.hide() .appendTo('#midsize'); .attr('src', 'carousel-swede/images/covers/large/300-1.jpg');
[object HTMLInputElement] ?
Hello guys I already tried searching this in google. But I really don't understood this error since I'm new to JQuery. I hope someone here has kind heart and help me with this small problem. Below are my codes, index.php <!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> <title>Submit form using Jquery to MySQL with PHP</title> <meta http-equiv="Content-Type" content="text/html;
Having a problem with autocomplete
I am trying to use the autocomplete plugin with a large database (over 3000 items). It is very slow to work until the user gets to the 3rd character and then it is reasonable. I am trying to use the minChars option but it doesn't seem to have an effect. The relevant sections of code looks like this (I have left off the intervening HTML and code) $(function() { $( "#tags" ).autocomplete(Member,{ minChars: 3, source: MemberName }); }); <script> var MemberName=new Array();
.val problem
Hi, I have the following: $('td').keyup(function() { for(i=0; i<1; i++) { total = $('#sellshippingvat').val() ; alert(total) ; } $('#purtot').text(total); }) ; The form field is a text input field with the id/name of sellshippingvat. But it is not getting the value like it should, what is wrong?
Loop over json data structure?
Hi, I have the following data structure (shown in code view below) coming back from a query. How can I loop over this and create an <li></li> for each record on the client side? The end result should be : <li><a href="page.htm?id=1">Kate</a></li> <li><a href="page.htm?id=2">Sarah</a></li> <li><a href="page.htm?id=3">Tricia</a></li> The dynamic parts in bold. { "ROWCOUNT":3, "COLUMNS":["ID","NAME"], "DATA":{ "id":[1.0,2.0,3.0], "name":["Kate","Sarah","Tricia"] } }
Next Page