Re: [jQuery] Re: Sortable list - even when list is changed

2010-02-23 Thread Peter Edwards
In your example, you have two calls to $('#elements').sortable(). The second one has the update event added, but the first (the one which creates the sortable) doesn't. If you add the update handler to the first call, it works OK. on 23/02/2010 08:26 rafald said:: Hi , please check this:

Re: [jQuery] Re: Sortable list - even when list is changed

2010-02-23 Thread Peter Edwards
No problem, $(document).ready(function(){ }); and $(function(){ }); are the same - both will run whatever you have in them when the DOM is ready - the second is just a kind of shorthand for the (much easier to read) first. Docs: .ready() http://api.jquery.com/ready/ $(callback)

Re: [jQuery] How to select every checkbox on my page inside a fieldset

2010-02-15 Thread Peter Edwards
You can use selectors to do this quite easily - I've posted an example at: http://jsbin.com/uwaxo/ This has: 1. a checkbox which will select/deselect all others in the page (no matter whether they are in different forms/fieldsets, 2. a checkbox which uses a descendant selector $('#fieldset1

Re: [jQuery] google.load(jquery) and jquery plugins

2010-01-27 Thread Peter Edwards
Use google.setOnLoadCallback to add whatever plugins you need using jQuery's $.getScript function like this: google.load(jquery, 1); google.setOnLoadCallback(function() { $.getScript(http://inlinemultiselect.googlecode.com/files/jquery.inlinemultiselect-1.2.min.js;, function(){

Re: [jQuery] iPhone: split jquery script file

2010-01-14 Thread Peter Edwards
There is an interesting article about optimising YUI for Safari/iPhone at: http://tinyurl.com/y97karc (there was a problem with the blog's database connection, so this links to a cached version) With the following in it: Some examples of the kinds of things an iPhone-specific site doesn’t need:

Re: [jQuery] Re: iPhone: split jquery script file

2010-01-14 Thread Peter Edwards
requests sooner keep with the minified and gzipped version to keep the data sent across the connection to a minimum...ripping apart the library just doesn't seem worth the payoff, which isn't much anyways On Jan 14, 10:08 am, Peter Edwards p...@bjorsq.net wrote: There is an interesting

Re: [jQuery] any help on this!!!

2010-01-12 Thread Peter Edwards
You need a hash symbol for your button selector, and change the toggle to click: $(#dt-link1).click(function() { $('#jqdt').find('ol li:eq(0)').css(color,Blue); return false; }); on 11/01/2010 22:45 JQueryNewbie said:: I cant get my color change on my listitem. any help would be

Re: [jQuery] Custom animations

2010-01-10 Thread Peter Edwards
Hi there, I've put up a basic example of how you would do this at: http://jsbin.com/ahevu (to edit the code, go to http://jsbin.com/ahevu/edit) I've used mouseenter to demonstrate - if you need a hover effect, then you will need to save the original dimensions/position of the div you are

Re: [jQuery] Generating a CSV of values from a bunch of Checkboxes with same id

2010-01-09 Thread Peter Edwards
You could use the title attribute rather than your non-standard txt attribute, and achieve the same thing using: script type=text/javascript $(document).ready(function(){ $(#tryme).click( function(){ var checkedGenres = []; $(input[rel='genre']:checked).each(function(){

Re: [jQuery] Re: Debuging AJAX

2009-11-25 Thread Peter Edwards
Hey, don't use document.write() or alert() to debug - either use console.log() or have a div in the document which can display debugging information and append any data to it. $('#testform').live('submit',function(){ var formData = $(this).serialize(); console.log(formData);

[jQuery] Re: Ajax - Access data arguments in callback

2009-09-18 Thread Peter Edwards
Hi there, The only way I could find to do this with the $.get function was to parse out the query string - the success callback should get a copy of the options object which was used to set up the ajax request, but the data parameter is NULL in this object for GET requests (it is populated

[jQuery] Re: Paste an image into a tag...

2009-09-18 Thread Peter Edwards
Have you thought of using a rich text editor to do this such as TinyMCE and FCKEditor - they both have paste from clipboard functionality On Fri, Sep 18, 2009 at 11:12 AM, Hogsmill i...@hogsmill.com wrote: This may or may not be possible, but if anyone knows a way to do it, I'd love to hear

[jQuery] Re: Using jQuery to see if CSS is disabled.

2009-09-05 Thread Peter Edwards
You could try looping through the document.styleSheets collection and testing the disabled attribute: var styleSheetsDisabled = false; for (var i = 0; i document.styleSheets.length; i++) { if (document.styleSheets.item(i).disabled) { styleSheetsDisabled = true; } } Not sure if this

[jQuery] Re: search list in a div for attribute value

2009-08-29 Thread Peter Edwards
Try this - it may work for you: $(function(){ var srch = [ foo, bar ] ; // make a Regex from the search terms var attr_regex = '('+srch.join('|')+')'; $('#gallery li').each(function(){ if ($(this).attr(title).match(attr_regex)) { $(this).css({background:'#f00'}); } }); });

[jQuery] Re: Getting XML info problem

2009-08-25 Thread Peter Edwards
Your code suffers from asynchronousitis. You call the ajax request, but alert the total before the response can alter the variable. Try doing it in the success callback as the previous poster suggested and you will get the correct value: var total = 0; function readXML(section) {

[jQuery] Re: form elements brainteaser

2009-08-19 Thread Peter Edwards
Hi Chris, I have a working example at: http://jsbin.com/udota/ I've made the number of second inputs configurable so you can test it. All you need now is a way of checking if they all add up to 100 if you make them user configurable - I'll leave that up to you though! Peter on 19/08/2009

[jQuery] Re: Manipulate href

2009-08-17 Thread Peter Edwards
Hi knal This works for me: $(function(){ $('#my_list a').each(function(){ var href = $(this).attr(href); /* remove trailing slash if present */ if (href[(href.length-1)]===/) { href = href.substr(0,(href.length-1)); } /* now get the last part of the path */ var

[jQuery] Re: Add extra content to the title attribute

2009-08-11 Thread Peter Edwards
try this: $(a.newWindow).attr(title, $(a.newWindow).attr(title)+ - This link will open in a new window); On Tue, Aug 11, 2009 at 10:45 AM, Paul Collins pauldcoll...@gmail.comwrote: Hi all, This is hopefully simple. I have a bunch of links with titles, like TITLE=Facebook and so on. I am

[jQuery] Re: jQuery toggle question

2009-08-06 Thread Peter Edwards
I've reworked your code a little with a working example at: http://jsbin.com/ecumi I have changed classes and ids in the document a little to make it easier to do the selectors, but I know it could probably be done more efficiently. Peter on 06/08/2009 01:13 ripcurlksm said:: For once, I

[jQuery] Re: More fun with decrementing on click

2009-08-03 Thread Peter Edwards
Hi Nick $(.number).html(count--); count-- decrements your count variable after it has passed its value to the $.html() function. use --count Peter on 03/08/2009 21:15 littlerobothead said:: I have a status area in an app I'm working on. It shows the number of unread alerts. As the user

[jQuery] Re: Check if movie (.mp4) is finished

2009-07-26 Thread Peter Edwards
Hi Eswip, It is possible to use the getEndTime method of the quicktime movie, but I think only when the plugin/movie has loaded. Apple docs: http://developer.apple.com/documentation/QuickTime/REF/QT41_HTML/QT41WhatsNew-74.html Not sure how you would implement this though... bjorsq on

[jQuery] Re: URL generated by Ajax

2009-07-15 Thread Peter Edwards
Hi JD, In your success callback, you have access to ajax options through the this keyword, so you can get the full URL by doing this within the success callback: alert(this.url+'?'+this.data); peter on 15/07/2009 13:30 Mean Mike said:: if you just need to see what your posting and what

[jQuery] Re: Determine content type in $.post callback

2009-07-13 Thread Peter Edwards
Hi Dimitriy, To get the options used by the xhr request (including the ContentType header), use the this keyword in the callback function: $.post(url, data, function(){ /* the content of this from a typical $.post operation this[type]=POST this[url]=url this[data]=data

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-13 Thread Peter Edwards
Hi Matt, The if and else blocks are not both being executed. try this: $(function(){ $('#billable_checkbox').change(function(event){ if (this.checked) { $('#billable_hidden').attr(disabled, disabled); } else { $('#billable_hidden').removeAttr(disabled); } }); }); The

[jQuery] Re: jQuery on IE

2009-07-09 Thread Peter Edwards
Why is the type attribute of the script tag set to application/x-javascript rather than text/javascript ? on 09/07/2009 21:40 Paulodemoc said:: the address to js is correct, it opens just fine. I created a new document: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://

[jQuery] Re: PDF + Jquery + thickbox is not suppoting to Mozilla

2009-06-22 Thread Peter Edwards
Hi Bharath, Your code would never work on my machine (even in IE) as I have set it up so PDFs display in a standalone reader (i.e. do NOT use the browser plug-in). Is the problem that the PDF does not download at all in Mozilla under some set of circumstances? Peter on 22/06/2009 11:10

[jQuery] Re: Autoselect a checkbox on user's input value

2009-05-26 Thread Peter Edwards
Try this: $(function(){ $('#DNnumber').keyup(function(){ if (parseInt($(this).val()) 40) { $('#external').attr(checked, checked); $('#internal').attr(checked, ); } else { $('#external').attr(checked, ); $('#internal').attr(checked, checked); } }); }); on

[jQuery] Re: JQuery css selector

2009-05-18 Thread Peter Edwards
$('#delete_item a').click(function(){ return (confirm('Are you sure?')); }); This will only work if there is one item to delete on the page because it uses an ID selector. If you have multiple items, use a class selector instead. on 18/05/2009 08:43 ocptime said:: Hi everyone, How

[jQuery] Re: JQuery css selector

2009-05-18 Thread Peter Edwards
Take a look at this example: http://bjorsq.net/selector.html on 18/05/2009 11:07 ocptime said:: Hi, It's not working :). How can i select using the jquery ul li selector? Thanks ocptime On 18 May, 13:39, Peter Edwards p...@bjorsq.net wrote: $('#delete_item a').click(function

[jQuery] Re: Conflicts between scripts

2009-05-15 Thread Peter Edwards
You can avoid this conflict altogether (and reduce downloads considerably) using slimbox or thickbox http://www.digitalia.be/software/slimbox (lightbox clone for jQuery) http://jquery.com/demo/thickbox/ (can use to achieve lightbox effect, but much more versatile - can handle anything - not

[jQuery] Re: how to uncheck the check box

2009-05-15 Thread Peter Edwards
There are a few ways to do this. You can select by class, in which case you give a group of checkboxes the same class $(function(){ // attach a click event to each checkbox whose class is 'onechecked' $(':checkbox.onechecked').click(function(){ // if the clicked checkbox is checked (no

[jQuery] Re: jQuery Ajax SUCCESS: using 'THIS'?

2009-05-01 Thread Peter Edwards
Hi Roman, You need to copy the reference to your link to a variable like this: jQuery('#yt1').click(function(){ $(this).replaceWith(iApproving.../i); var aObj = $(this); jQuery.ajax({ 'type':'POST', 'data':'id=205', 'dataType':'text', 'success':function(msg){

[jQuery] Re: How to prevent loading jquery twice

2009-03-23 Thread Peter Edwards
Are you using joomla to load jQuery? or are you wringin script tags in some sort of template? I came across this: http://www.packtpub.com/article/using-javascript-effects-with-joomla which seems to imply joomla can handle you script inclusion. hope this helps on 23/03/2009 11:41 Andy789

[jQuery] Re: OnMouseDown = create draggable, OnMouseUp = create droppable

2009-03-09 Thread Peter Edwards
Have you tried the jQuery UI mailing list? Why not create draggable and droppable at the same time? The way I understand it, a draggable is created so it can be dropped on a droppable, so the two are linked and it makes sense to create them at the same time. Or do you need to create hundreds

[jQuery] Re: One page site multipage degradation

2009-02-13 Thread Peter Edwards
I don't know why IE does this but you shouldn't need to re-write the href attribute anyway - I'm assuming you attach a click event to the buttons to load content, so just return false from the click event handler and the link won't be followed - you can leave the href attribute intact.

[jQuery] Re: how to differentiate between click and dragend events?

2009-02-11 Thread Peter Edwards
the event order is mousedown-mouseup-click the 'dragend' event is triggered by mouseup, which happens before the click event, so if you put logic in your function dragged() to prevent clicked() from doing whatever it does, then the click event which is triggered at the end of a drag should be

[jQuery] Re: Hide specific characters

2009-01-23 Thread Peter Edwards
Try this: $(.cartSummaryItem).each(function(){ $(this).html($(this).html().replace(/,[^]*/, ' ')); }); It takes the html content of the cartSummaryItem table cell, and replaces everything from the comma to the start of the View Cart link with a space, then resets the contents of the table

[jQuery] Re: Need some help with image map coding....

2008-09-19 Thread Peter Edwards
Hi Aaron, The following code should help: $(document).ready(function(){ $('area').each(function(){ $(this).attr(href, #); $(this).click(function(){ $('#ajaxresult').load('map.php', {'state':$(this).attr('alt')}); return false; }); }); });

[jQuery] Re: $.post callback problem

2008-09-12 Thread Peter Edwards
It looks like you have a rogue parenthesis to me - $.post($(this).attr(href)) - the last closing parenthesis completes the $.post call, so your callback function will not fire. on 11/09/2008 21:49 Tom Shafer said:: i am trying to use data i am getting back from $.post but I am not able to

[jQuery] Re: attr('form') not work in firefox

2008-05-19 Thread Peter Edwards
I don't think it is correct to call this an attribute, as this implies that you can specify it in the HTML (it is not an allowed attribute in the W3C specification). It should be a cross-browser property of all form elements though. on 19/05/2008 15:54 Ariel Flesler said:: No, you're right.

[jQuery] Re: events on embedded SVG

2008-03-25 Thread Peter Edwards
The SVG DOM is different to the HTML DOM (which jquery was written for) - a lot of things are the same, so you may have some luck using jquery in SVG (there are some threads dealing with SVG related issues in this list which should give you an indication of what to look out for). In the last

[jQuery] Re: slidetoggle jumps in IE

2008-03-09 Thread Peter Edwards
You could write out a style rule in your script to hide them: dcoument.write('style type=text/css.sub_section {display:none;}/style'); Or set display to none in some other way (using script so the page is rendered correctly in non-javascript browsers). on 08/03/2008 23:36 rocksou said:: I am