[jQuery] Plugins/Validation/validate is there a way to add css class to wrapper option?

2009-06-11 Thread Gauthier Segay

I would like to wrap validation messages in  with
validate plugin

is there any event or option I can handle to tweak the element before
it is appended?

I'm unsure if something like that would look ok:

$('form').validate({wrapper:"li.error"});

or either

$('form').validate({wrapper:""});

Any work around is welcome.

Best regards


[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread David .Wu

it's work, cool.

On 6月11日, 下午11時58分, Tomáš Kavalek  wrote:
> Maybe you should use json_decode($json, true); in case of you have a
> problem with json_decode($json);
>
> On 11 čvn, 14:17, Chris Chen  wrote:
>
> > $json = $_POST['json'];
> > $user = json_decode($json);
> > echo $user['name'];
>
> > 2009/6/11 Val Cartei 
>
> > > with data.name (data is the json object you pass to your success
> > > function). Like:
>
> > > success: function(data) {
> > >                alert(data.name);
> > >        }
>
> > > Val
>
> > > On Thu, Jun 11, 2009 at 12:40 PM, David .Wu wrote:
>
> > > > If I send a json format to php, how to get the value from php? for
> > > > example
>
> > > > front page
> > > > 
> > > > var jsonStr = '{"name": "David", "age", "23"}';
> > > > $.ajax({
> > > >        url: 'json.php',
> > > >        type: 'POST',
> > > >        cache: false,
> > > >        data: {json: jsonStr},
> > > >        success: function(data) {
> > > >                alert(data);
> > > >        }
> > > > });
> > > > 
>
> > > > php page
> > > >  > > > $json = $_POST['json'];
>
> > > > // it's get {"name":"David","age": "23"}, but how to gete name?
> > > > ?>
>
> > > --
> > > Valentina Cartei
> > > Telephone Numbers:
> > > University +44 (0) 1273 877560
> > > Work +44 (0) 1273 206306
> > > Mobile +44 (0)796 6882820
>
> > --
> > Chris


[jQuery] Re: remove question

2009-06-11 Thread brian

On Thu, Jun 11, 2009 at 10:44 PM, David .Wu wrote:
>
> Can I remove div1 but div2 keep there?
>
> 
> 
> 

Someone (Karl?) answered the same question recently. You just replace
the outer div with the inner.

Note that you can't have an element ID starting with a number, though.
Let's call them div_1 & div_2.

$('#div_1').replaceWith($('#div_2'));


[jQuery] Re: remove question

2009-06-11 Thread Steven Yang
i guess you just have to move div 2 somewhere else before you remove div 1


[jQuery] Re: select top level of nested structure

2009-06-11 Thread brian

Actually, I've just gotten it working. It's amazing what a dinner
break can do for a stalled mind.

As it turns out, I do, in fact, need to be able to sort the deeper
list items. Luckily, a requirement is that they *not* be moved into a
new list.

I forgot to mention earlier that I'd tried using index() with the same
bad results. In any case, since I now have no need to limit this to
the top level, my selector has become much simpler. Using index()
works. Although, I think that I might have had an error somewhere
else.

So, in case someone else stumbles upon this and it's useful, this is
what I ended up with:

/* add drag handles to each section list item
 */
$('#section_list li').each(function()
{
$(this).prepend('');
});

var start_pos;

$('#section_list ul').sortable({
items: 'li',
axis: 'y',
containment: 'parent',
delay: 0,
distance: 4,
helper: dragHelp,
forceHelperSize: true,
forcePlaceholderSize: true,
handle: 'a.Handle',
tolerance: 'pointer',
cursor: 'move',
opacity: 0.6,
zIndex: 200,

start: function(event, ui)
{
start_pos = 
$(ui.item).parent('ul').children('li').index($(ui.item));
},
update: function(event, ui)
{
/* element ID is of the form 'section_n'
 */
var item_id = 
$(ui.item).attr('id').substring('section_'.length);

/* get end position
 */
var end_pos = 
$(ui.item).parent('ul').children('li').index($(ui.item));

/* number places moved
 */
var delta = Math.abs(end_pos - start_pos);
var direction = (start_pos < end_pos) ? 'down' : 'up';

showIndicator('#section_content', {top: 100});

$.ajax({
url: 
'/admin/sections/move/'+direction+'/'+item_id+'/'+delta,
cache: false,
timeout: 1,
success:
function(text)
{
hideIndicator();
alert(text);
},
error:
function (XMLHttpRequest, textStatus, 
errorThrown)
{
alert(textStatus);
}
});
}
});

The 10 sec timeout is because I still need to tidy things up server
side. It's working, though it's ridiculously slow.

I had a spot of trouble getting the end position. I'd have thought
that this should do it:

$(ui.item).siblings('li:not(li ul li)').andSelf().index($(ui.item));

But I got consistently bad numbers again. I couldn't figure out how to
get only the siblings within the same UL (and the item being moved)
except to do:

$(ui.item).parent('ul').children('li').index($(ui.item))

I'll bet there's a better way than that.

Sorry for not providing a link to explain MPTT. It stands for Modified
Preorder Tree Traversal. It's actually much easier to grasp than the
name suggests. You can read a pretty good overview here:

http://www.sitepoint.com/article/hierarchical-data-database/

Here's a more in-depth article:
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

The short version is that each record has parent_id, left, and right
fields (usually lft & rght). This allows for a tree hierarchy.

I'd been thinking that I'd need to pass the parent_id, lft, and rght
values in addition to the id. Meaning that I'd also need to store
those somehow when the page was first rendered, perhaps in hidden
spans or something similar (I wouldn't want to pollute the DOM). But,
it turns out that I can simply pass the number of places to move by,
as well as the direction.

Next, I'll have to figure out how to re-order across 2 lists, if only
to satisfy my own curiosity (or the ever-changing whims of the
client).

On Thu, Jun 11, 2009 at 10:21 PM, Charlie wrote:
> one little addition to markup add an id ="list" to ul due to $sortable
> requirements
>
>          $("#section_list li:not('li ul li')").each( function(i) {
>
>             position= i+1
>   myId="foo_"+position
>
>     $(this).attr("id",myId);
>   
>
>         });
>
>         $("#list").sortable();
>
>
>
>         $("button").click(function() {
>
>         var result = $('#list').sortable('toArray');// this returns id's in
> order they appear after sort, parse out the foo_
>
>         alert(result);
>
>         });
>
> i don't understand the MPTT stuff, or implications but hope this helps
>
>
> brian wrote:
>
> Given the following structure:
>
> 
>   
>   
>   
>   
>  

[jQuery] remove question

2009-06-11 Thread David .Wu

Can I remove div1 but div2 keep there?






[jQuery] Re: select top level of nested structure

2009-06-11 Thread Charlie





one little addition to markup add an id ="list" to ul due to $sortable requirements

         $("#section_list li:not('li ul li')").each( function(i) {
            position= i+1
		myId="foo_"+position
    $(this).attr("id",myId);
		

        });
        $("#list").sortable();
           

        $("button").click(function() {
        var result = $('#list').sortable('toArray');// this returns id's in order they appear after sort, parse out the foo_
        alert(result);
        });
i don't understand the MPTT stuff, or implications but hope this helps
 

brian wrote:

  Given the following structure:


	
		
		
			

			
		
		
			

			
		
	


How should I select just the top-level list items? I thought
'#section_list > ul > li' should do it but it doesn't appear to be so.
At least, the code I've got is giving me strange results. I'd like to
confirm whether my selector is good or not.

What I'm trying to do is get the position of a list item (only looking
at the top level). I'm using sortable and need to be able to get the
start and end positions of the item so i can update the database. What
I've come up with so far is to call this function from sortable's
start callback. It seems like an ugly way to go about this but I'm a
bit stumped as to a better way.

function getStartPosition(id)
{
	var position = 0;
	$('#section_list > ul > li').each(function(indx, el)
	{
		if ($(el).attr('id') == id) { position = indx + 1; }
	});
	return position;
}

Not only does it look hacky, but it's giving me obviously bad results.

To complicate things further, I'm using MPTT for my tree data, so
sortable's serialize isn't much help, unfortunately. I originally
thought I might figure out the parent_id, lft, and rght values upon
sort but that would entail storing all that data somewhere in the DOM.
I then realized that, if I can just get the number of positions moved,
I could update the DB with that information.

All this to say that, if someone else has tackled this, I'd really
appreciate some pointers.

  






[jQuery] Re: how to assign date picker for all class "date" ?

2009-06-11 Thread Steven Yang
$('.datepicker').datepicker()
only applies to the input with class=datepicker when you call it.
so any new added element will not be affected


[jQuery] Re: using find method on a documentFragment attached node

2009-06-11 Thread Charlie





var d=$('div.pointer').length;

alert(d);

amit wrote:

  Hi,

I am writing an application that converts an ajax xml response into
html using client side xslt transformation. The transformation is
achieved using following snippet, which works fine -

	transform:function(xml){
		if (window.XSLTProcessor){
			var xsltProcessor = new XSLTProcessor();
			xsltProcessor.importStylesheet(Xmer.xsldoc);
			var outputXHTML = xsltProcessor.transformToFragment(Xmer.makeXml
(xml), document);
			document.getElementById('tree').appendChild(outputXHTML.cloneNode
(true));
		}
		else if(window.ActiveXObject){	//Internet Explorer
			var d=Xmer.makeXml(xml);
			var outputXHTML = (d).transformNode(Xmer.xsldoc);
			document.getElementById('tree').innerHTML=outputXHTML;
		}
	}


But problem is encountered in FF when i try to process the inserted
tags using jquery's find method. I am trying to fetch all the divs
with a specific class name that were inserted by the above code using
following -
	var d=$document.find('div.pointer');
   alert (d.length);

but the above alert always returns "0" length.  The same code works
fine in IE. I am using jquery 1.3.2.

I apologize if something along these lines has been discussed earlier
and would appreciate if someone guides me in this.

Thanks,
amit


  






[jQuery] Re: Accordion List Issue

2009-06-11 Thread Charlie





exactly

terry irwin wrote:
Thanks Charlie, 
  
Do you mean using it like this ?
  
$(document).ready(function(){
       $("#accordion").accordion({
               active: false,
               collapsible: true,
   navigation : true 
       });
});
  
  
  
  On Thu, Jun 11, 2009 at 11:19 PM, Charlie 
wrote:
  
navigation : true 

In accordion will match link within accordion content to page url and
open that section when page loads





Skunkmilk wrote:

  Hi All,
Very new to Jquery and was hoping i can get some help.

I have an accordian list much like the example here :
http://docs.jquery.com/UI/Accordion#option-active

Say for instance i have page links under the heading 'Section 2' of
that demo above.
How can i make it so that when you visit a page from these links
'Section 2' is visible and 'section 1' and 'section 3' are closed?

At the moment i have :

$(document).ready(function(){
   $("#accordion").accordion({
   active: false,
   collapsible: true
   });
});




   Section 1
   
   
   Link 1
   Link 2
   Link 3
   
   
   Section 2
   
   
   Link 1
   Link 2
   Link 3
   
   
 Section 3
   
   
   Link 1
   Link 2
   Link 3
   
   




Can someone advise what i need to add to make 'Section 2" visible
only ?

Thanks in advance

  





  
  
  






[jQuery] Re: Accordion List Issue

2009-06-11 Thread terry irwin
Thanks Charlie,

Do you mean using it like this ?

$(document).ready(function(){
   $("#accordion").accordion({
   active: false,
   collapsible: true,
 *  navigation : true *
   });
});



On Thu, Jun 11, 2009 at 11:19 PM, Charlie  wrote:

>  navigation : true
>
> In accordion will match link within accordion content to page url and open
> that section when page loads
>
>
>
>
> Skunkmilk wrote:
>
> Hi All,
> Very new to Jquery and was hoping i can get some help.
>
> I have an accordian list much like the example here 
> :http://docs.jquery.com/UI/Accordion#option-active
>
> Say for instance i have page links under the heading 'Section 2' of
> that demo above.
> How can i make it so that when you visit a page from these links
> 'Section 2' is visible and 'section 1' and 'section 3' are closed?
>
> At the moment i have :
>
> $(document).ready(function(){
>$("#accordion").accordion({
>active: false,
>collapsible: true
>});
> });
>
>
> 
> 
>Section 1
>
>
>Link 1
>Link 2
>Link 3
>
>
>Section 2
>
>
>Link 1
>Link 2
>Link 3
>
>
>  Section 3
>
>
>Link 1
>Link 2
>Link 3
>
>
> 
> 
>
>
> Can someone advise what i need to add to make 'Section 2" visible
> only ?
>
> Thanks in advance
>
>
>
>
>


[jQuery] Re: New plugin announcement and review request - bullsEye

2009-06-11 Thread Orkan

$(document).ready(function(){
$('div#bullseye').bullseye({
'use_rows':3,
'use_cols':3,
});
});

try to remove the last comma from options obj. IE doesnt like it.

btw, nice idea, I like it very much. Is there a way to disable that
tooltip?


On Jun 11, 9:48 pm, Tony Landis  wrote:
> Thanks. Can you describe what is happening in IE7? I don't have access
> at this time.
>
> On Jun 10, 6:50 am, Leonardo K  wrote:
>
> > Great plugin!
>
> > It would be nice if the plugin was functional at least in IE7
>
> > On Tue, Jun 9, 2009 at 22:48, Tony Landis  wrote:
>
> > > I wrote a jQuery plugin "bullsEye" for that provides some
> > > visualization effects for large data tables, and would like any
> > > usability suggestions or bug reports. So far I have tested it in the
> > > latest version Firefox, Safari, and Opera.
>
> > > Description, download, live examples, and screenshots of the plugin in
> > > action are located here:
>
> > >http://tonylandis.com/uncategorized/bullseye-jquery-plugin-to-add-int...
>
> > > If anyone finds this useful I would like to know.
>
> > > Thanks,
> > > Tony Landis


[jQuery] Plugin for transparent rounded corners with borders?

2009-06-11 Thread docmattman

Is there a jQuery plugin that does transparent rounded corners and
keeps the borders of a div?  I found and tried several rounded corner
plugins already, but they either remove the border that I have around
the div and/or don't have transparency (i.e. white rounded corners).
Is there a plugin that accomplishes this?


[jQuery] css() function returns different results on different browsers

2009-06-11 Thread upsilon

Hi everyone!

Today I've tried to create simple hover effect on a : if the
cursor is over the box, the background-image css property of the div
is modified.

On the HTML side, a  with an id:
Blah blah

On the CSS:
div#round {
background-image: url(pics/bg_round.png);
}

In order to get the background-image property, I wrote:
var imgName = $("#round").css('background-image');

The issue is on what I get from this function in Internet Explorer and
in Firefox:
IE : url("http://blabla/images/bg_round.png";)
FF : url(http://blabla/images/bg_round.png)

OK, the difference is not huge, and I've already solved the problem by
replacing quotes by nothing in the string.

But... Is this a bug? A feature? jQuery is intended for erasing
differences between browsers, and here it's not the case...
What do you think of it?

Thanks!
upsilon

PS: sorry for my English (I'm French), I'm afraid that 15 years of
studies aren't enough for me... :(


[jQuery] Clicking a draggable item doesn't allow input "blur"

2009-06-11 Thread docmattman

I have a text input that I want automatically submitted when the user
clicks outside of the input area (i.e. when the input is blurred).
This works fine in many areas of the page.  However if the user
happens to click on a "draggable" item (UI/Draggable), the input blur
never occurs and it doesn't get submitted.  I have many draggable
items on this particular page, so there is a good chance that the user
could click one of them to blur the input.

Does anyone else have this problem?  Is there a way around this?


[jQuery] Re: tabs and ajax

2009-06-11 Thread nextpulse

I reported this before - since you can easily reproduce it with the
sample code.

But someone removed the thread, so here the archive link:

http://www.nabble.com/bugs-with-multiple-fast-tab-clicks-tp23785806s27240p23785806.html



On Jun 11, 4:01 am, cwiese  wrote:
> I have the SAME ISSUE -  SAME VERSIONS - my tabs worked prior to
> upgrading to Jquery
> UI 1.7.
>
> Now, when using REMOTE (ajax) tabs - if a user click a tab - while
> another is loading the Ajax does get called, and the DIV gets
> populated but
> the CLASS that determines which tab is visible does not every change
> for the 2nd click.the first request is displayed - even though
> with firebug I can see the 2nd DIV content is loaded.
>
> Uggworking perfectly with the older version of tabs (and
> Jquery 1.2.6).
>
> So, in shortfast clicking is NOT necessary - any remote load
> taking
> more than 1 second gives the user a chance to click another tabs -
> which gets loaded but never displayed.
>
> The DIV for the 2nd click still has "ui-tabs-hide" and the first
> clicked is visible. Has the "queuing" of Ajax calls been changed in
> Jquery 1.3x?
>
> Here is the declaration:
>
> var $tabs;
> $(document).ready( function() {
>         $tabs = $("#assign-tabs").tabs( {
>                 remote: true,
>                 ajaxOptions: {cache: false},
>                 spinner:'Loading...',
>                 //toggle - below is ugly
>                 fx : {
>                         opacity: 'show' ,
>                         height: 'show',
>                         duration: 'slow'
>                 },
>                 onShow : function(clicked, shown, hidden) {//(event,
> ui) { //TODO
>                         if (jQuery.browser.msie) {
>                                 ui.panel.style.removeAttribute
> ('filter');
>                                 };
>                         $(ui.panel).find
> (":text:visible:enabled:first").focus();
>             }
>         });
>
> });
>
>  
>          "Standard 
>          "Corporate 
>          "Population 
>
> 
> 
> 
>          " "
>                 width="30" alt="" />
> 
> 
>          " "
>                 width="30" alt="" />
> 
> 
>          " "
>                 width="30" alt="" />
> 
> 
>
> On Jun 10, 4:47 pm, nextpulse  wrote:
>
> > jquer - 1.3.2
> > jqueryui - 1.7.1
>
> > On May 30, 3:01 am, Klaus Hartl  wrote:
>
> > > Which version are you using? I've fixed a similiar bug (if not the
> > > same) bug a while ago...
>
> > > --Klaus
>
> > > On 28 Mai, 19:30, nextpulse  wrote:
>
> > > > I have 3 tabs that each loads using ajax (via href).
> > > > The problem i am having is that while a tab is loading - the user can
> > > > click on another tab (as they should).
> > > > But the tab panel rendering then gets confused - depending how long
> > > > the ajax takes or how quickly the tabs are clicked - the results can
> > > > (and do) come back on a different panel.
>
> > > > Is this a bug or another way around this?
>
> > > > I don't want to disable the tab - as it is very reasonable for a user
> > > > to click on the another tab while one is loading.
>
> > > > My current workaround is to avoid the ajax in the tab and make a call
> > > > via the the 'select'. This works good - but then I lose all the nice
> > > > features of the loader info on the tab display (and the cache).- Hide 
> > > > quoted text -
>
> > - Show quoted text -


[jQuery] Re: jQuery UI dialog not behaving

2009-06-11 Thread Charlie






try taking the dialog constructor out of the click functions maybe load
is firing before the dialog call is complete
this seems to be the norm, not trying to build it inside a click

 also first link doesn't validate on w3 validator, always worth
checking validation when DOM weirdness occurs

fredriley wrote:

  Sorry to post again, but again jQuery has me defeated completely
despite using simple code. This time I'm trying to use the excellent
UI library, and in particular dialogue windows. All I want to do is
open an external file in a dialogue, to save using standard popup
windows. I've got a test up at http://www.nottingham.ac.uk/~ntzfr/test/ajax/jquery/jqueryui_dialogue_test1.html
and there are quite a few things wrong:

1. Sometimes the Ok button just doesn't close the window.
2. I can't get the maxHeight and maxWidth options to kick in.
3. I can't get any resizability or draggability.
4. On external links I can't stop the link working despite the
standard "return false" in the click function.
5. Firefox and Safari behave differently.

I've downloaded a custom UI 1.7.1 library, with all widgets but no
interactions or effects, so I suspect that 2 and 3 are down to not
having interactions - would this be right? The other problems have me
stumped after 3 hours of testing.

A weird thing is that the dialogues behave sort of ok in another test
form, for instance:

http://www.nottingham.ac.uk/~ntzrlo/rlos/database/test/edit_rlo_tabs.php?rlo_num=18

Click on "View all keywords in the database". Yet I'm using exactly
the same code in both docs, calling exactly the same core and UI
libraries.

My head hurts, and it's 9pm on a Friday evening. Maybe it'll be
clearer on Monday, but in the meantime if anyone's got suggestions as
to:

a) why is code working on one doc and not the other
b) what's the best way of opening up another doc in a dialogue

Thanks.

Oh, and does anyone know how I can subscribe to a thread on this board
to get notifications of new posts?

Cheers

Fred

  






[jQuery] Re: How to flip the image?

2009-06-11 Thread Kean

Pretty easy to do with  and the JavaScript that came with it.
However, you might have be aware of the compatibility issues
surrounding it.

On Jun 11, 1:16 pm, waseem sabjee  wrote:
> I once came across a php class the worked exactly like jquery selectors.
> retrieveing text etc directly into php
>
> the problem was it made a web page incredably slow. does anyone have
> something a bit more lightweight ?
>
> On Thu, Jun 11, 2009 at 5:18 PM, Jônatan Fróes wrote:
>
>
>
> > You can make it with PHP. Try this class:
> >http://www.verot.net/php_class_upload_samples.htm


[jQuery] Re: Sortable Gallery?

2009-06-11 Thread James

Jack,

That's the one! Thanks SO much.  I must not have dug deep enough on
nettuts.

Appreciate the help.

Thanks again.
-James

On Jun 10, 10:09 pm, Jack Killpatrick  wrote:
> Maybe this is the tutorial:  
> http://nettuts.com/tutorials/javascript-ajax/creating-a-filterable-po...
>
> - Jack
>
> James wrote:
> > Hey all,
>
> > I am new to jquery. Managed so far to get a carousel up and going,
> > some tabbed interfaces etc. Nothing spectacular.
>
> > A week or so ago, I found a tutorial on how to build something like
> > this (http://jasonsantamaria.com/portfolio/) in jquery. Basically a
> > group of thumbnails, each given a category id, that corresponds to the
> > right nav, that then sorts and displays the thumbnails according to
> > user selection.
>
> > Anyone know of an existing tute out there for something like that? or
> > know what current jquery library item I should look at to build
> > something similar?
>
> > Appreciate any assistance.
> > Thanks
> > James


[jQuery] Re: binding and re-binding

2009-06-11 Thread Ricardo

You can find all information about live() at jQuery docs:
http://docs.jquery.com/Events/live#typefn

On Jun 11, 4:32 pm, Kean  wrote:
> Instead of doing
>
> $(selector).click(function(){});
> $(selector).bind('click', function(){});
>
> use
>
> $(selector).live('click', function(){});
>
> On Jun 11, 12:04 pm, Sasha  wrote:
>
> > Hi everyone.  I've run across what must be a common problem:
>
> > When my page loads, I bind every element of a certain class to some
> > function (via click, focus, or whatever).  Then I dynamically create
> > another element with that same class on the page, and the new element
> > lacks the binding.
>
> > Is there a nice shorthand way of saying "bind this function to this
> > class/id/selector always and forever," no matter whether matching
> > elements are created or destroyed?  I'd rather not have to worry about
> > re-binding my elements every time I create new ones.
>
> > Thanks! SA


[jQuery] Re: Hide parent where a child contains....

2009-06-11 Thread mkmanning

$("fieldset:has(legend:contains('Promotions'))").hide()

On Jun 11, 10:43 am, Jesse  wrote:
> I'm sure that I'm just missing something simple. Basically, I'm trying
> the hide the "" element if it contains "Promotions legend>" but I can't get it to work. Here is my latest
>
> jQuery("fieldset:has('legend':contains:('Promotions'))'").hide();
>
> I've tried several variations of this, including trying to hook onto
> the parent element and such, but I just can't get anything to work.
> I'll supply what my HTML code looks like below. Any help would be
> appreciated.
>
> Categories
>
> 
>     Cuisines
>     
>     
>     
> 
>
> 
>     Atmosphere
>     
>     
> 
>
> 
>     Promotions
>     
>     
>     
>     
>     
>     
> 


[jQuery] Re: ownerDocument is null

2009-06-11 Thread Kean

this[0].ownerDocument

It's used by some functions to create elements that can be appended,
wrapped, inserted into your current element. Meaning the created
elements must match the same document context as the current element.

It can be troublesome when

this[0] === document

as document.ownerDoucment returns null

Please post this in the dev mailing list with a concrete description
of how this can be reproduced.

On Jun 11, 6:19 am, pribis  wrote:
> JQuery 1.3.2,  FF3, IE6/7 (not sure of others).
>
> this[0].ownerDocument is null  Line 4187
>
> I occasionally get the above error.  It appears that jquery sometimes
> gets a hold of the actual document and so doesn't have an owner
> document.
>
> Does anyone have suggestions as to what can cause this (or could point
> me to a post that addresses this)?   I've temporarily gotten around it
> by modify jquery to test for null ownerDocument and returning the same
> as if this[0] were null, but I hate to do this since it is probably my
> code that's the problem.
>
> Thanks
>
> Brian


[jQuery] Re: How to flip the image?

2009-06-11 Thread waseem sabjee
I once came across a php class the worked exactly like jquery selectors.
retrieveing text etc directly into php

the problem was it made a web page incredably slow. does anyone have
something a bit more lightweight ?

On Thu, Jun 11, 2009 at 5:18 PM, Jônatan Fróes wrote:

>
> You can make it with PHP. Try this class:
> http://www.verot.net/php_class_upload_samples.htm
>


[jQuery] jQuery UI dialog not behaving

2009-06-11 Thread fredriley

Sorry to post again, but again jQuery has me defeated completely
despite using simple code. This time I'm trying to use the excellent
UI library, and in particular dialogue windows. All I want to do is
open an external file in a dialogue, to save using standard popup
windows. I've got a test up at 
http://www.nottingham.ac.uk/~ntzfr/test/ajax/jquery/jqueryui_dialogue_test1.html
and there are quite a few things wrong:

1. Sometimes the Ok button just doesn't close the window.
2. I can't get the maxHeight and maxWidth options to kick in.
3. I can't get any resizability or draggability.
4. On external links I can't stop the link working despite the
standard "return false" in the click function.
5. Firefox and Safari behave differently.

I've downloaded a custom UI 1.7.1 library, with all widgets but no
interactions or effects, so I suspect that 2 and 3 are down to not
having interactions - would this be right? The other problems have me
stumped after 3 hours of testing.

A weird thing is that the dialogues behave sort of ok in another test
form, for instance:

http://www.nottingham.ac.uk/~ntzrlo/rlos/database/test/edit_rlo_tabs.php?rlo_num=18

Click on "View all keywords in the database". Yet I'm using exactly
the same code in both docs, calling exactly the same core and UI
libraries.

My head hurts, and it's 9pm on a Friday evening. Maybe it'll be
clearer on Monday, but in the meantime if anyone's got suggestions as
to:

a) why is code working on one doc and not the other
b) what's the best way of opening up another doc in a dialogue

Thanks.

Oh, and does anyone know how I can subscribe to a thread on this board
to get notifications of new posts?

Cheers

Fred


[jQuery] Re: Get all unique class names

2009-06-11 Thread Kean











var allClassName = $('option').map(function(){
  return this.className;
}).get();

var uniqueClassName = $.unique(allClassName); // returns an array of
unique class name


On Jun 11, 7:01 am, David  wrote:
> I'm interested in getting an array of unique class names of all option
> tags under a specific select element.
>
> I'm imagining something like this (which does not do what I want): $
> ( '#select_id option.class' );
>
> What's the correct way to do this using jQuery?
>
> Thanks!


[jQuery] Re: New plugin announcement and review request - bullsEye

2009-06-11 Thread Tony Landis

Thanks. Can you describe what is happening in IE7? I don't have access
at this time.


On Jun 10, 6:50 am, Leonardo K  wrote:
> Great plugin!
>
> It would be nice if the plugin was functional at least in IE7
>
> On Tue, Jun 9, 2009 at 22:48, Tony Landis  wrote:
>
> > I wrote a jQuery plugin "bullsEye" for that provides some
> > visualization effects for large data tables, and would like any
> > usability suggestions or bug reports. So far I have tested it in the
> > latest version Firefox, Safari, and Opera.
>
> > Description, download, live examples, and screenshots of the plugin in
> > action are located here:
>
> >http://tonylandis.com/uncategorized/bullseye-jquery-plugin-to-add-int...
>
> > If anyone finds this useful I would like to know.
>
> > Thanks,
> > Tony Landis
>
>


[jQuery] Re: click function on anchor element

2009-06-11 Thread Kean

Interesting! That's also the same with labeling object properties. The
label will be casted into their string representation.

asdf

$('#ya').click(function(){
   a = {};
   a[this] = 1;
   cache = this;
});

alert(a[cache.toString()]); // alerts 1

On Jun 11, 12:16 pm, Ricardo  wrote:
> Just clearing up what Pierre said: if the argument you passed to alert
> () is not a string, it's .toString() method will be called. For
> convenience, the toString on an anchor HTMLElement object returns it's
> href. Try this:
>
> $('a').get(0).toString();
> or
> $('a').click(function(){
>    alert( this.toString() );
>    return false;
>
> });
>
> "this" in your code is still an object, it's just the output of
> toString() that is different.
>
> cheers
> -- ricardo
>
> On Jun 11, 1:10 am, "bensan...@gmail.com"  wrote:
>
> > Hi all,
>
> > I'm confused as to why when I have:
>
> > $('a').click(function(){
> > alert(this);
> > return false;
>
> > });
>
> > the alert displays the URL defined in the href attribute, and not an
> > object.
>
> > Yet, if i call like say an image, it returns the object.
>
> > Thanks
> > ben


[jQuery] Re: How to flip the image?

2009-06-11 Thread Jônatan Fróes

You can make it with PHP. Try this class:
http://www.verot.net/php_class_upload_samples.htm


[jQuery] Re: binding and re-binding

2009-06-11 Thread Kean

Instead of doing

$(selector).click(function(){});
$(selector).bind('click', function(){});

use

$(selector).live('click', function(){});


On Jun 11, 12:04 pm, Sasha  wrote:
> Hi everyone.  I've run across what must be a common problem:
>
> When my page loads, I bind every element of a certain class to some
> function (via click, focus, or whatever).  Then I dynamically create
> another element with that same class on the page, and the new element
> lacks the binding.
>
> Is there a nice shorthand way of saying "bind this function to this
> class/id/selector always and forever," no matter whether matching
> elements are created or destroyed?  I'd rather not have to worry about
> re-binding my elements every time I create new ones.
>
> Thanks! SA


[jQuery] Re: Get all unique class names

2009-06-11 Thread Andy Matthews

And as a side note, IDs should already be unique on a page. If they're not,
then you're going to encounter unexpected issues in your code. 


Andy matthews

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Andy Matthews
Sent: Thursday, June 11, 2009 2:19 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Get all unique class names


This should get you started:

var $allID = $('*[id!=]'); 

It returns a jQuery object containing all elements that have an id attribute
that is not empty. Tested with the following HTML:


something else
this is some text right here



It returns an array:

[div#something, h1#else, img#another]


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of David
Sent: Thursday, June 11, 2009 9:02 AM
To: jQuery (English)
Subject: [jQuery] Get all unique class names


I'm interested in getting an array of unique class names of all option tags
under a specific select element.

I'm imagining something like this (which does not do what I want): $ (
'#select_id option.class' );

What's the correct way to do this using jQuery?

Thanks!





[jQuery] Re: Get all unique class names

2009-06-11 Thread Andy Matthews

This should get you started:

var $allID = $('*[id!=]'); 

It returns a jQuery object containing all elements that have an id attribute
that is not empty. Tested with the following HTML:


something else
this is some text right here



It returns an array:

[div#something, h1#else, img#another]


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of David
Sent: Thursday, June 11, 2009 9:02 AM
To: jQuery (English)
Subject: [jQuery] Get all unique class names


I'm interested in getting an array of unique class names of all option tags
under a specific select element.

I'm imagining something like this (which does not do what I want): $ (
'#select_id option.class' );

What's the correct way to do this using jQuery?

Thanks!




[jQuery] Re: click function on anchor element

2009-06-11 Thread Ricardo

Just clearing up what Pierre said: if the argument you passed to alert
() is not a string, it's .toString() method will be called. For
convenience, the toString on an anchor HTMLElement object returns it's
href. Try this:

$('a').get(0).toString();
or
$('a').click(function(){
   alert( this.toString() );
   return false;
});

"this" in your code is still an object, it's just the output of
toString() that is different.

cheers
-- ricardo

On Jun 11, 1:10 am, "bensan...@gmail.com"  wrote:
> Hi all,
>
> I'm confused as to why when I have:
>
> $('a').click(function(){
> alert(this);
> return false;
>
> });
>
> the alert displays the URL defined in the href attribute, and not an
> object.
>
> Yet, if i call like say an image, it returns the object.
>
> Thanks
> ben


[jQuery] Re: tablesorter doesn't do anything, it doesn't show up, it doesn't create an error. Nothing.

2009-06-11 Thread sso

I'm not sure when it started working because I made all the rows of
data have the same content.   It does sort, but it still looks plain.
I'm using the full path to the css file.   
http://www..com/dev/js/themes/blue/style.css


I can put the css file link in the web browser and open it, but it
still isn't being applied to the table.  I'm at a loss.

Thanks for the help aquaone :)  I'm not giving up

On Jun 11, 2:29 pm, sso  wrote:
> It also doesn't list anything under "required" except for jquery-
> latest and tablesorter.js
>
> On Jun 11, 2:22 pm, sso  wrote:
>
>
>
> > By css, you mean the theme?  (blue or green) ?
>
> > On Jun 11, 2:09 pm, aquaone  wrote:
>
> > > Are you sure it's not working?
> > > Often people haven't included the accompanying CSS and don't realize that 
> > > it
> > > is working -- They just don't see the changes because they didn't include
> > > the CSS.
>
> > > aquaone
>
> > > On Thu, Jun 11, 2009 at 11:06, sso  wrote:
>
> > > > I've used tablesorter before.  I know its not intended to be
> > > > complicated, so I assume I'll want to slap myself when I figure out
> > > > how simple the problem was.
>
> > > > when I put other functions in my document.ready they work fine.
>
> > > > from the head tag:
>
> > > >   > > > script>
> > > >