[jQuery] Sortable callback?
Hello! So I have a simple sortable list with jQuery UI's .Sortable() function. I am hoping to have it fire off a function right after any of the list items are moved. From the documentation, "update" seems to be the paramater to pass it to get it to do that: $(".list").sortable({ handle : ".draggertab", update : function(){ console.log("order changed"); } }); But my little function there to log something to the console doesn't seem to be firing off when I drag a list item and the list is resorted.
[jQuery] Odd IE7 problem with (I think) a selector and LiveQuery.
I have a script which, in a nutshell, replicates the functionality of a small Excel spreadsheet the company uses for invoices. It has buttons for save, open, add a row, remove a row, etc., and everything works fine in every browser I've run it on. The only exception is one small but crucial bit that isn't working in IE7. $('tr:not(#grandrow)').livequery('change', function() { ... //recalculate that row and totals ... } When a user changes any of the fields (for example, the quantity of a specific
[jQuery] the ready not working properly
Hello. I discovered some time ago that in browsers based on WebKit, the ready to jQuery not working properly. Looking into the code of jQuery 1.3.1 in binready I noticed it was missing the code. Because it tests only for IE and mozilla. It does not test for Opera, Safari and Chrome. Here is the code I found on the net. Is it possible to tell me whether it will be added or if I should use another function. Thank you in advance.
[jQuery] Complex selector: bug on IE
Hello, I have a problem with jquery 1.2.6 and IE (6 and 7). When I use this code : http://pastebin.me/4986d5d6f219d it doesn't work on IE. Well, it works but just the first time. It's like the jquery object contains just the first element, not every *[id^='MULTI-EXPERIENCE-'][id$='-EXPERIENCE_EN_POSTE_1'] elements... Do you have a solution? Thanks.
[jQuery] SUPERFISH Vertical Help
RE: Vertical hover. I am trying to do the following and can not figure out what CSS code controls these things: • Move the bullets off the left edge of both parent and sub “buttons” • Make the “buttons” shorter (set height) • Move the hover flyout “button” to butt up against the parent. Currently there is a gap between the left edge of the parent and the right edge of the flyout. Thanks, this is a great menu!
[jQuery] Load JSON, Use It via Callback, Then Destroy?
I'm repeatedly loading data via JSON every 2 seconds or so to keep a page updated. Each time data is returned. I take the data, update a list (the list can only have 5 items) and then never reference the data again. If I let this run for an hour, it crashes Safari. Looking at the inspector palette, it looks as if every document is loaded and stays loaded. I'm basically poking around at this point, but my thought was that I need to somehow "unload" the JSON data that was loaded (and the associated
[jQuery] click Event not working on first binded element on IE after one click
So, I am implementing a page on which words that have hints associated in the DB are binded with the click event to show the Hint. Initially, I go through and replace the words with html that goes <span class="hint">word</span> So, then I bind the hint class with the click event, $(".hint").bind("mouseup",function(e) { var clickElement = e.target; var clickText = $(clickElement).text(); $.post('term.cfc?method=getTermDef&returnFormat=json', {term:clickText},showHint,"json"); } ) The problem
Newbie question about attr()
I am trying to get the "id" of an object (or any attribute, really). I am building the objects from a database, so I set the id attribute equal to the unique id from the database. I am having the same problem getting any attribute, so I am using the alt attribute below (it's a bit simpler example). This code: alert($(this).html()); Returns: <img style="border: 0px none ; margin-top: 5px; margin-left: 3px; margin-right: 3px;" src="images/RedDown.png" alt="Vote Down"> However, this code: alert($(this).attr("alt"));
[jQuery] Multiple Block UI
Hi, I am using block UI to block an element on my page with a message centered in it. E.g. $('#elementID').block({ message: $ ('#messageID') }); My problem is when I try and use block UI to also show a modal popup while still blocking my element, the text which appeared in the centre of my blocked element disappears and my modal popup appears fine. Can anyone help me get past this problem with using the Block UI more than once? Thanks Chris
[jQuery] Beginner Q: setTimeout on multiple objects
I have 5 images which I want to fade in and out randomly and independently from each other. This is the code I have so far: $('.main_nav img').each(function() { $(this).css("opacity", 0); animatedLink = this; t = setTimeout("timedAnim(animatedLink)",getRandom()); }); function getRandom() { return (Math.random()*1000)+600; } function timedAnim(obj) { if(($(obj).css("opacity")) == 0){ $(obj).css("opacity", 1); } else{ $(obj).css("opacity", 0); } animatedLink = obj; t = setTimeout("timedAnim(animatedLink)",getRandom());
[jQuery] [TUTORIAL] How to load content via AJAX in jQuery
Hi there guys! It's me one more time... I just want to present you a new tutorial that I have published focused in load dynamically some static content in their websites via AJAX. http://yensdesign.com/2008/12/how-to-load-content-via-ajax-in-jquery/ I hope you find it useful, as always!
[jQuery] a solution
The src is defined with the assumption that the call is originating from a single source, and it seems that the source path isn't always the same. So I believe the banner is black(blank) because the browser cannot find "images/"filename" from its originating source and cannot display anything.. By defining the src with the full URL to the file, I was able get the images to display correctly. The solution also caused the banner to take the place of, or cover the system logo. To have the logo display
[jQuery] How to use the $() function
Please take a look at the following code: return $('> li:not(' + notSortable + ')', settings.columns); Is it equivalent to the following? var notSortableLi = $(html>li:not(notSortable)); return $(notSortableLi, settings.columns); I found the origianl code on http://nettuts.com/tutorials/javascript-ajax/inettuts/. var notSortable holds a list of ids, and settings.columns holds the value .column. I am finding the use of single quotes very confusing. Same goes for the > without anything to the left
Count checked checkboxes
I have a jQuery object that contains a list of <input type="checkbox"> elements: var boxes = $(whatever).find("input[type=checkbox]"); I need to know whether all of them are checked (just need true or false). This does work: var all = true; boxes.each(function(){ if( $(this).is(":not(:checked)") ){ all = false; return; } }); However, I can't understand why I can't manage to do it using selectors. All these lines returns zero in all cases: boxes.find(":checked").length boxes.find(":is(:checked)").length
adding attributes
Is there a standard jquery command to write inside a tag? I'd like to write a script that writes in the target attribute for every a href that has a value of pdf in it. I have everything written but the part to add in the attribute, and I don't think .prepend or .append would do it.
[jQuery] Quick Question about the ui.datepicker
Hi there's a couple of things that id like to ask. Here is my code: $(function() { $('#deliverydate').datepicker({ minDate: +1, maxDate: '+1Y', changeMonth: true, changeYear: true, showOn: 'both', buttonImage: '../../images/general_images/calendar.jpg', buttonImageOnly: true, altField: '#actualDate', altFormat: 'yy-mm-dd', }); }); basically I want the user to see the date in the 'dd-mm-yy format' (this already happens) but i want the post information to
[jQuery] Beginner Q: setTimeout on multiple objects
I have several images that I'd like to fade in and out randomly and independently from each other. This is the code I have so far, but the only thing that happens is the last image blinking three times. I'm guessing that I shouldn't use the same variable (t) for every animation but I don't really know how I would do this. Anyone care to help? This is the code: $('.main_nav img').each(function() { $(this).css("opacity", 0); animatedLink = this; t=setTimeout("timedAnim(animatedLink)",getRandom());
UI: Drag contents of one portlet into another?
I have a proof of concept up with the UI provided Portlets. What I would like to do is drag one portlet into another, and have the contents of the first portlet be copied into the second (both portlets contain unordered lists). I'm trying to conceptualize how this could be done with jQuery UI. Should this be possible with the Portlets and possibly with the help of the draggable library? Any ideas?
[jQuery] [validation]
my script works in Firefox, but not in IE6/7, what can be wrong? part of the form is supposed to be hidden to begin with, and checking certain radiobuttons should trigger it visible with the show/hide method of the jquery here's link: http://semeinaliga.org/donations/onetime/ thanx a bunch in advance
Selecting An Element By Id
So I am new to jquery, I have been using Prototype. So far, loving jquery, but I have one bone to pick. Maybe I am doing something wrong, or there is a better way to do this, but I do alot of checking or selecting an element by id. In prototype easy as: $("myTextBoxId") Jquery makes this easy too: $("#myTextBoxId") But jquery breaks doing: $("#myTextBoxId").value.length, it seems that everything is always returned as an array, so I must do: $("#myTextBoxId").get(0).value.length or $("#myTextBoxId")[0].value.length.
fileupload does not work
hey i have now changed my code for the form plugin which have ajax fileupload... but it does not work :/ in the form plugin doku is writen: File input elements are automatically detected and processed for you. my codes: the form: <form id="uploadForm" enctype="multipart/form-data" action="takeedit1.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" id="MAX_FILE_SIZE" value="100000" /> <input type="file" name="file" size="70"> <input name="Submit" type="submit" id="submit" value="submit"
[jQuery] regexpr question i'm getting stupid
hello i want t maxe a regexp search in javascript with an variable te var reg = new RegExp("/\b("+te+")\b/"); pos = node.data.toUpperCase().search(reg); that was my oppinion but it don't works my oppinion was that because var reg = new RegExp(/\b(TEXT)\b/); pos = node.data.toUpperCase().search(reg); works but how can i replace TEXT with the variable te??? thanks for your replies
jquery slide down function with a contact form
Hi, I'm using the following code (taken from design shack) for a slide down form. The problem is when I send the form #messagesent doesn't show and the form just slides back up. I've looked at a few tutorials and tried a few things but without success. Could anyone help? Thanks. $(document).ready(function(){ $("#contactLink").click(function(){ if ($("#contactForm").is(":hidden")){ $("#contactForm").slideDown("slow"); } else{ $("#contactForm").slideUp("slow"); } }); }); function closeForm(){ $("#messageSent").show("slow");
What are the rules for $() ?
Hello, I am jquery noob. I understand that $('p') would return all the p elements. But what happens when you put two parameters in the the $() ? Please take a look at the code below. I got it from http://nettuts.com/tutorials/javascript-ajax/inettuts/ I understand what it's doing but I don't understand why it's doing it or what the rules are. // Loop through each widget within the columns: $(settings.widgetSelector,$(settings.columns)).each(function (i) { Note: setting.widgetSelector and setting.columns
[jQuery] unsubscribe
<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"> </td></tr></table>
[jQuery] UNSUBSCRIBE
Simple problem - running jq from a jq-generated div?
Hi there, I'd be so grateful if anyone can spare a few mins to glance at my problem... What the below script does: Populates .rs_details/.rs_venues/rs_headliners with information from a hidden div (this comes from php) What I to do: Get a jquery tooltip/lightbox (anything) to work based on a .click link that's inside one of the jquery populated divs. For some reason it doesn't work? I can get my j query tooltips/lighbox to work anywhere except in these jquery populated divs? ahhhh! Hope someone can
append to a href
not sure if its the right way basically what i wanna do is when someone clicks on a certain check box it will add &edit=1 to the existing url $(".edit ul li a").append("&edit=1"); ?
[jQuery] failing .click() trigger on element created using .replaceWith()
Hey guys, Simple problem, really can't see what's wrong with it though: http://internetessentials.co.uk/clients/ashmoors/products.html Click "Specifications" on the sub-nav (middle-right of page) and see how the content area is changed using show/hide and the links in the sub-nav are modified so that "Specifications" is no longer and link but "Furniture detail" is. The idea is that we want "Furniture details" and "Specifications" to be toggeled with JQuery. The other links to go to separate pages.
Making ajax links bookmarkable (history)
Hi - I've got a site that uses a jquery ui accordion to load content into a container div via an ajax call. I would like to have the links in the accordion update the page's href with their url onclick, but I don't want to force a page reload since content is served via ajax. I've tried using the history_remote plugin for this without much luck (double-loads in firefox, no hash updates in IE7) I'm looking for an alternative solution. My link syntax is like so: http://foo.aspx?page=3 (this is actually
[jQuery] Convert jquery object to a string
Hi all, Is there a simple way to convert jquery object to a string and back? I need to store a generated html dom structure in the database and restore it back to html. Any suggestions how to do it properly? Thank you
Popup textbox for asp.net using jQuery
Hi all. I would like to implement the following scenario: a user clicks inside a textbox and a popup textbox is displayed where you can enter text, and by clicking an OK button the text is then copied from the popup textbox to the target textbox. Let me just say that I've tried implementing it with asp.net ajax, and it's not a very easy task, to say the least. Since, I'm a total noob to jQuery and would very much to try an alternative to existing AJAX technologies, please be gentle... Thanks in advance.
[jQuery] [autocomplete] Calling decodeURIComponent
Hello! I've recently become involved with a project where we use the jQuery Autocomplete plugin, and It's been working like a charm except for one thing. On our backend code we output data in an url encoded format (space becomes %20 and so on), and in our jQuery code we want to decode this to be more readable. To fix this in the autocomplete list we can specify the formatItem option to a callback function which decodes the data, but when the users selects a value from the list the data being put
[jQuery] Problem in Auto Complete
Hello to all of you, I am using Jquery Auto-Complete Plugin with Rails. My Task is: A text field where user will type(say "cri"), the auto complete list will show the possible options (like "cricket"), once cricket is selected the auto complete list will show another possible options that comes under cricket (like "Matches", "Teams", "Scores" etc.). How would I do that using jquery? Right now I am using this code and able to get 1 level of records successfully: posts_controller.rb class PostsController
[jQuery] invoke cluetip from javascript
My Code looks somthing like this when i hover on the icon i can see the message on click i am changing the properties, as it shows, will this work <script> function sayHello() { $.fn.cluetip.defaults.sticky=true; $.fn.cluetip.defaults.activation='focus'; document.getElementById("test12345").focus(); } </script> <a class="title" title="Test the clue Tip|Tip: Test the clue Tip.Test the clue Tip.Test the clue Tip." href="#" id="test12345" onclick="javascript:sayHello()" ><img src="test.png"></a>
[jQuery] How to invoke cluetip from a javascript
I shuld have a clue tip which on hover of element shold display message, and on click of same element, the cluetip should be sticky, how to do this
[jQuery] pass variable from button to jquery
I am displaying a bunch of data from a mysql database, shown below. After the data is displayed, I put a button for each line of data. When a user clicks the button, I call the load function. I am trying to figure out how to pass the id (received from the mysql db) for each particular record to the jquery load function. Here is my code: [code] html.... while($row = mysql_fetch_array($result)) { echo $row['day']; echo "</td><td>"; <button class="volunteer" value="volunteer">Volunteer</button>
[jQuery] IE8 Jquery support
Jquery's features dont work to well with IE 8 RC1 I tried the slimbox and there was no transparency and also on the jquery homepage the pictures that you rollover then new information fades in doesn't work well.
[jQuery] Having a problem with checkboxes
Hi, I am using this: <input type="checkbox" name="paradigm" value="{$value.ver_id}" /> $(document).ready(function(){ $("#paradigm_all").click(function(){ var checked_status=this.checked;$("input[@name=paradigm]").each (function(){ this.checked=checked_status; }); }); }); to check and uncheck a list of articles. Now I want to sumbit the checked articles, but I don't know how to do that. I can't use <input type="checkbox" name="paradigm[]" value="{$value.ver_id}"
[jQuery] [validate], jquery validation
Good day. I'm using FF 3.0.5 and Chrome. I'm generating validation script on server-side and embed it into page before sending response to a client. The problem is that FireBug doesn't show JS error, but nothing happens. Validation doesn't take place. Please, see my page code. It is much bigger, but I've shortened it. Excuse me for native language, but they are just captions, they don't play any significant role. When I try to enter invalid data to field, nothing happens. Seems like validation doesn't
Next Page