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)
http://api
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:
http
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
in
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(){
$('s
ust a few 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 Edwa
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:
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
app
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 anim
You could use the title attribute rather than your non-standard txt
attribute, and achieve the same thing using:
$(document).ready(function(){
$("#tryme").click( function(){
var checkedGenres = [];
$("input[rel='genre']:checked").each(function(){
checkedGenres.pu
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);
$.post('
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 wrote:
>
> This may or may not be possible, but if anyone knows a way to do it,
> I'd love to hear from you.
>
> Ba
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
b
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 wou
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'});
}
});
});
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) {
$.ajax(
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
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 ancho
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 wrote:
> Hi all,
> This is hopefully simple. I have a bunch of links with titles, like
> TITLE="Facebook" and so on. I am adding JQuer
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
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 c
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 25/07
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 ur
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");
}
});
});
Th
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
this[succ
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:
http://www.w3.org/1999/xhtml";>
Astral
alert($);
and
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 jaz
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");
}
});
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 wrote:
$('#delete_item a').click(functio
$('#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
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 ne
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 j
Hi Roman,
You need to copy the reference to your link to a variable like this:
jQuery('#yt1').click(function(){
$(this).replaceWith("Approving...");
var aObj = $(this);
jQuery.ajax({
'type':'POST',
'data':'id=205',
'dataType':'text',
'success':function(msg){
alert(aObj.attr(
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 said::
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 o
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.
$(".
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 b
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 tab
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;
});
});
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
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.
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 S
You could write out a style rule in your script to hide them:
dcoument.write('.sub_section
{display:none;}');
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 having an issue with the
42 matches
Mail list logo