[jQuery] Re: Image inside script

2009-08-26 Thread Fabio

Hi Paolo ,

I Tried perpending

like this


var errImg = '/img/errIcon.gif';

$("."+errId).attr("style","display: inline; color: red");$
("."+errId).prepend('  ');$
("."+errId).html(' Invalid Character. Numerals only.');}

which should have worked like a magic.. but unfortuneltly  something
is causing the image not to render ... could u please help me figure
out the issue

the image is placed under the web content/themes/img/errorIcon.gif

Thanks
Fabio




'  '
On Aug 27, 10:05 am, Fabio  wrote:
> Hi Paolo ,
>
> I tried doing this
>
>         {$("."+errId).attr("style","display: inline; color: red");$
> ("."+errId).html("
> > Invalid Character. Numerals only.");}
>
> since the image is not picking up from the /img/ folder  i am
> trying to access with a help of the context path .Or is there a work
> around for this .
>
> early reply would be appreciated.
>
> Thanks
> Fabio
>
> On Aug 26, 11:29 pm, Paolo Chiodi  wrote:
>
>
>
> > $("."+errId).prepend('');
>
> > On Wed, Aug 26, 2009 at 5:45 AM, Fabio wrote:
> > > $("."+errId)


[jQuery] Re: Integration: cross-slide, fancybox, galleryview

2009-08-26 Thread pdxgeek

almost forgot:  I was wondering if part of the problem was the z-index
cluster that is a result of stacking all these plugins together.
The parsed code has a crapload of z-index values that I believe are
part of the conflict somewhere.  I'm still trying to pick it apart but
thought someone more knowledgeable might be able to easily tell what's
going on...


[jQuery] Integration: cross-slide, fancybox, galleryview

2009-08-26 Thread jQnoob

hello all,
I'm not experienced or knowledgeable enough to troubleshoot this issue
and although in the past I've been extremely lucky when it comes to
manipulating javascript to meet my needs, this time I'm out of my
league more than usual.

I'm trying to combine the function of three plugins: cross-slide,
fancybox, and galleryview.

Basically, I have a page with a grid of images utilizing cross-slide
for captions on mouse-over.  I then integrated fancybox to bring up
the galleryview in a lightbox-like window.

Finally I wanted to embed galleryview within the fancybox that pops
up.

The problem seems to be a conflict with fancybox and galleryview.
>From what I can tell, as soon as I click and fancybox opens a window,
it freezes galleryview and makes it non-functional.  I think there may
be some conflicting jQuery between the two.  I had a problem with
clicks inside the fancybox that were meant to navigate the images
actually closing the box, but I got rid of that by altering the
fn.fancybox.close function of the fancybox script.

Any help would be most appreciated.  I'm pretty good about
troubleshooting when the error console spits something out, but I'm
lost here.  Thanks.

Here's a link to the code, stripped down:
www.uxable.com/_test/



[jQuery] Re: previous value ands remote validation

2009-08-26 Thread Jules

May be you should put the remote validation in field A instead of B,
passing both A and B values to the server side.

On Aug 26, 4:42 pm, marcp  wrote:
> hi all,
>
> i have 2 fields in my form with 1 being currently validated with a
> remote method (say Field B).
> I would like to make a dependency between fieldA and fieldB so i tried
> to add a blur function on field A with jQuery("#FieldB").valid()
>
> but when i change FieldA's value no remote validation occurs because
> there is a check (if value != previous value)
>
> is there a way for me to disable this cache ? or to reset previous
> data ?
>
> thanks for any help.
>
> regards,
>
> marc


[jQuery] Re: Image inside script

2009-08-26 Thread Fabio

Hi Paolo ,

I tried doing this

{$("."+errId).attr("style","display: inline; color: red");$
("."+errId).html(" Invalid Character. Numerals only.");}

since the image is not picking up from the /img/ folder  i am
trying to access with a help of the context path .Or is there a work
around for this .

early reply would be appreciated.

Thanks
Fabio

On Aug 26, 11:29 pm, Paolo Chiodi  wrote:
> $("."+errId).prepend('');
>
>
>
> On Wed, Aug 26, 2009 at 5:45 AM, Fabio wrote:
> > $("."+errId)


[jQuery] Re: SimpleModal autoresize on demand?

2009-08-26 Thread Eric Martin

Vru,

The actual code would depend on exactly what you are trying to do, but
taking the "onShow callback function" test[1], I modified the code to
resize and reposition the container:

function modalShow (dialog) {
var self = this;
dialog.data.find('input.animate').one('click', function () {
dialog.container.animate({height:"+=50", width:"+=50"}, 1000,
function () {
self.setPosition();
});
});
}

[1]: http://www.ericmmartin.com/simplemodal-test/

Hope that helps.

-Eric

On Aug 26, 7:52 pm, Veeru  wrote:
> Hi there,
> I have been using simpleModal
> Was wondering if there is a way to resize simplemodal on demand; in
> other words; i would like to change the height/width of simple modal
> when the content has changed. As of now, if the content has changed
> and grown, it overflows the simplemodal dialog.
>
> Any suggestions?
>
> Thanks
> Vru


[jQuery] Re: focus() killed by return false;

2009-08-26 Thread shenry

I tried both Hector's suggestion and Karl's, neither solved the
problem.

In both cases the field has focus while it's sliding in, then when the
animation is done focus is lost. Oddly, I noticed if I navigate away
from this page by going to another tab in FF, when I return to this
page the field *has* focus. Strange. This doesn't happen in Safari.

I'm pulling my hair out, any other ideas? Am I doing something wrong??

S

On Aug 26, 7:28 pm, Karl Swedberg  wrote:
> If Hector's suggestion doesn't work, try using preventDefault()  
> instead of return false:
>
> $(function() {
>         $("#login a").click(function(event) {
>                 event.preventDefault();
>                 $("#login").animate( { width: 300, height: 20 }, 500);
>                 $("#login a").hide("slide", null, 500, loginCallback);
>         });
>
> });
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Aug 26, 2009, at 1:20 AM, shenry wrote:
>
>
>
> > I have an anchor tag that, when clicked, reveals a login form. I'd
> > like the first field in the form to have focus when its revealed, and
> > I can see that it does as it's being revealed in the slide animation
> > but then focus is lost after return false;
>
> > any ideas?
>
> > Here is my code I'm new to jQuery, so any help is appreciated
>
> > $(function() {
> >    $("#login a").click(function() {
> >            $("#login").animate( { width: 300, height: 20 }, 500);
> >            $("#login a").hide("slide", null, 500, loginCallback);
> >            return false;
> >    });
> > });
>
> > function loginCallback() {
> >    $("#login_form").show("slide", null, 1000);
> >    $("input.focus").focus();
> > }
>
> > Thanks,
>
> > Stu


[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread John

I am working on the open source project: Tellurium automated testing
framework,
which is a web testing framework built on top of Selenium. We leverage
jQuery
to add jQuery selector as a locator to speed up the test performance
in IE and
also add other new functionalities. More details could be found at,

http://code.google.com/p/aost/wiki/TelluriumjQuerySelector
http://code.google.com/p/aost/wiki/jQuerySelectorCache

Basically, we define a UI in the format, for example,

ui.Container(uid: "GoogleSearchModule", clocator: [tag: "td"], group:
"true"){
   InputBox(uid: "Input", clocator: [title: "Google Search"])
   SubmitButton(uid: "Search", clocator: [name: "btnG", value: "Google
Search"])
   SubmitButton(uid: "ImFeelingLucky", clocator: [value: "I'm Feeling
Lucky"])
}

The framework will automatically generate the runtime jQuery selector
based on
the UI element attributes. We added the jQuery selector support couple
months
ago and it worked pretty well. Recently, one user tried to use the
style attribute,
but the generated jQuery selector did not work for the style
attribute. That is why
I am looking for a solution to this. Your insightful suggestions are
highly appreciated.

BTW, we only tested the style attribute in Firefox, but still not
working. :(.

Thanks,

John
On Aug 26, 4:34 pm, James  wrote:
> As Paolo mentioned, despite how it looks in a browser's source, the
> internal representation within the DOM may be different depending on
> the browser.
> In one browser it could be:
> overflow: auto; width: 356px; height: 100px;
>
> in another it could be:
> overflow:auto; width:356px; height:100px;
>
> in another it could be:
> overflow:auto;width:356px;height:100px;
>
> There's got to be a better way to achieve what you want to do. Since
> we have no idea what you're trying to do, maybe you could explain it
> as to what the rhyme or reason to the selection sets you're trying to
> select is.
> Looking at the code you've provided, is it possible to use the ID in
> anyway? You could do selections with conditions like "if ID begins
> with 'ext-gen'" and other conditions along with that. As long as
> you're not trying to read the style string.
>
> On Aug 26, 4:06 am,John wrote:
>
> > Thanks.
>
> > Here is the html source,
>
> >   > style="padding-left: 130px;">
> >         
> >              > value=""/>
> >              >                    size="24" readonly="true" style="width: 343px;"/>
> >              > src="images/s.gif"/>
> >         
> >     
>
> > The style in the jQuery selector should match the one defined in the
> > html source. I wonder if I
> > did any other thing wrong here.
>
> > Thanks,
>
> >John
> > On Aug 26, 6:45 am, Paolo Chiodi  wrote:
>
> > > Maybe that that the style attribute value should be exactly equal to
> > > the one contained in html. I think style="A:B C:D" doesn't match
> > > style="C:D A:B".
> > > May also be that the browser has an internal rapresentation of the
> > > style attribute slightly different from the one written in the html
> > > (never tried to see with firebug some differen orders?).
>
> > > Otherwise if you create the style attribute by using .css('A','B'),
> > > you can't be sure of what the entire style attribute could be.
>
> > > Paolo
>
> > > On Tue, Aug 25, 2009 at 11:22 PM,John 
> > > wrote:
>
> > > > Thanks Maurício for your quick response.
>
> > > > I have a program to automatically generate jQuery selectors based on
> > > > some UI element attributes and seems your syntax is not always
> > > > working. For example,
>
> > > > 1) working:  $('div:has(input[type=text][readonly=true], img
> > > > [style="overflow: auto; width: 356px; height: 100px;"]) img')
>
> > > > 2) Not working: $('div:has(input[type=text][readonly=true]
> > > > [style="width: 343px;"], img[style="overflow: auto; width: 356px;
> > > > height: 100px;"]) img')
>
> > > > 3) Not working:  $('div:has(input[type=text][readonly=true], img
> > > > [style="overflow: auto; width: 356px; height: 100px;"]) img
> > > > [style="overflow: auto; width: 356px; height: 100px;"]')
>
> > > > 4) Not working:  $('div:has(input[type=text][readonly=true]
> > > > [style="width: 343px;"], img[style="overflow: auto; width: 356px;
> > > > height: 100px;"]) img[style="overflow: auto; width: 356px; height:
> > > > 100px;"]')
>
> > > > Here "not working" means it returns empty object where it should
> > > > return non-empty object.
>
> > > > Do you know what is wrong?
>
> > > > Thanks again,
>
> > > >John
>
> > > > On Aug 25, 2:50 pm, "Mauricio \(Maujor\) Samy Silva"
> > > >  wrote:
> > > >> Sintax for the selector is:
>
> > > >> $('img[style="overflow: auto; width: 356px; height: 100px;"]')
>
> > > >> Maurício
> > > >>   -Mensagem Original-
> > > >>   De:John
> > > >>   Para: jQuery (English)
> > > >>   Enviada em: terça-feira, 25 de agosto de 2009 14:36
> > > >>   Assunto: [jQuery] jQuery selector for style attribute
>
> > > >>   Hi,
>
> > > >>   I want to select the following image using jQuery selector

[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread John

Also, it is not possible for us to use Ids because the ids are
dynamically
generated by the ExtJS framework.

On Aug 26, 4:34 pm, James  wrote:
> As Paolo mentioned, despite how it looks in a browser's source, the
> internal representation within the DOM may be different depending on
> the browser.
> In one browser it could be:
> overflow: auto; width: 356px; height: 100px;
>
> in another it could be:
> overflow:auto; width:356px; height:100px;
>
> in another it could be:
> overflow:auto;width:356px;height:100px;
>
> There's got to be a better way to achieve what you want to do. Since
> we have no idea what you're trying to do, maybe you could explain it
> as to what the rhyme or reason to the selection sets you're trying to
> select is.
> Looking at the code you've provided, is it possible to use the ID in
> anyway? You could do selections with conditions like "if ID begins
> with 'ext-gen'" and other conditions along with that. As long as
> you're not trying to read the style string.
>
> On Aug 26, 4:06 am,John wrote:
>
> > Thanks.
>
> > Here is the html source,
>
> >   > style="padding-left: 130px;">
> >         
> >              > value=""/>
> >              >                    size="24" readonly="true" style="width: 343px;"/>
> >              > src="images/s.gif"/>
> >         
> >     
>
> > The style in the jQuery selector should match the one defined in the
> > html source. I wonder if I
> > did any other thing wrong here.
>
> > Thanks,
>
> >John
> > On Aug 26, 6:45 am, Paolo Chiodi  wrote:
>
> > > Maybe that that the style attribute value should be exactly equal to
> > > the one contained in html. I think style="A:B C:D" doesn't match
> > > style="C:D A:B".
> > > May also be that the browser has an internal rapresentation of the
> > > style attribute slightly different from the one written in the html
> > > (never tried to see with firebug some differen orders?).
>
> > > Otherwise if you create the style attribute by using .css('A','B'),
> > > you can't be sure of what the entire style attribute could be.
>
> > > Paolo
>
> > > On Tue, Aug 25, 2009 at 11:22 PM,John 
> > > wrote:
>
> > > > Thanks Maurício for your quick response.
>
> > > > I have a program to automatically generate jQuery selectors based on
> > > > some UI element attributes and seems your syntax is not always
> > > > working. For example,
>
> > > > 1) working:  $('div:has(input[type=text][readonly=true], img
> > > > [style="overflow: auto; width: 356px; height: 100px;"]) img')
>
> > > > 2) Not working: $('div:has(input[type=text][readonly=true]
> > > > [style="width: 343px;"], img[style="overflow: auto; width: 356px;
> > > > height: 100px;"]) img')
>
> > > > 3) Not working:  $('div:has(input[type=text][readonly=true], img
> > > > [style="overflow: auto; width: 356px; height: 100px;"]) img
> > > > [style="overflow: auto; width: 356px; height: 100px;"]')
>
> > > > 4) Not working:  $('div:has(input[type=text][readonly=true]
> > > > [style="width: 343px;"], img[style="overflow: auto; width: 356px;
> > > > height: 100px;"]) img[style="overflow: auto; width: 356px; height:
> > > > 100px;"]')
>
> > > > Here "not working" means it returns empty object where it should
> > > > return non-empty object.
>
> > > > Do you know what is wrong?
>
> > > > Thanks again,
>
> > > >John
>
> > > > On Aug 25, 2:50 pm, "Mauricio \(Maujor\) Samy Silva"
> > > >  wrote:
> > > >> Sintax for the selector is:
>
> > > >> $('img[style="overflow: auto; width: 356px; height: 100px;"]')
>
> > > >> Maurício
> > > >>   -Mensagem Original-
> > > >>   De:John
> > > >>   Para: jQuery (English)
> > > >>   Enviada em: terça-feira, 25 de agosto de 2009 14:36
> > > >>   Assunto: [jQuery] jQuery selector for style attribute
>
> > > >>   Hi,
>
> > > >>   I want to select the following image using jQuery selector to see if 
> > > >> I
> > > >>   could use the style attribute,
>
> > > >>    > > >>   style="overflow: auto; width: 356px; height: 100px;" src="images/
> > > >>   s.gif"/>
>
> > > >>   but seems the selector
>
> > > >>   img[style=overflow: auto; width: 356px; height: 100px;]
>
> > > >>   does not work at all. What would be the correct selector for the 
> > > >> style
> > > >>   attribute?
>
> > > >>   Thanks in advance,
>
> > > >>  John


[jQuery] SimpleModal autoresize on demand?

2009-08-26 Thread Veeru

Hi there,
I have been using simpleModal
Was wondering if there is a way to resize simplemodal on demand; in
other words; i would like to change the height/width of simple modal
when the content has changed. As of now, if the content has changed
and grown, it overflows the simplemodal dialog.

Any suggestions?

Thanks
Vru


[jQuery] Re: not working in IE6

2009-08-26 Thread Karl Swedberg

Don't any one have a working example of this that show how to work
with SELECT OPTION element?


Not that I'm aware of. IE doesn't support onmouseover/onmouseout or  
onmouseetner/onmouseleave events on OPTION elements.


http://msdn.microsoft.com/en-us/library/ms536949%28VS.85%29.aspx#oATTable
http://msdn.microsoft.com/en-us/library/ms536945%28VS.85%29.aspx#oATTable

An alternative approach might be to convert the select element to  
something prettier:


http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




[jQuery] Re: focus() killed by return false;

2009-08-26 Thread Karl Swedberg
If Hector's suggestion doesn't work, try using preventDefault()  
instead of return false:


$(function() {
$("#login a").click(function(event) {
event.preventDefault();
$("#login").animate( { width: 300, height: 20 }, 500);
$("#login a").hide("slide", null, 500, loginCallback);
});
});

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Aug 26, 2009, at 1:20 AM, shenry wrote:



I have an anchor tag that, when clicked, reveals a login form. I'd
like the first field in the form to have focus when its revealed, and
I can see that it does as it's being revealed in the slide animation
but then focus is lost after return false;

any ideas?

Here is my code I'm new to jQuery, so any help is appreciated

$(function() {
$("#login a").click(function() {
$("#login").animate( { width: 300, height: 20 }, 500);
$("#login a").hide("slide", null, 500, loginCallback);
return false;
});
});

function loginCallback() {
$("#login_form").show("slide", null, 1000);
$("input.focus").focus();
}

Thanks,

Stu




[jQuery] Re: jQuery Form Plugin ajax submit

2009-08-26 Thread Jules

To protect the input fields, use readOnly instead of disabled and the
value will be included.

On Aug 21, 9:39 pm, Chris Hall  wrote:
> Using the following code:
>
> $('.input_all').attr("disabled", "disabled");
>
> for input texts with the class="input_all" seems to break jQuery forms
> ajax submit.
>
> How can I fix this?


[jQuery] Re: Looping through all unchecked checkboxes - how to do it?

2009-08-26 Thread Karl Swedberg

Hi Brett, this should do it.

$(':checkbox').each(function() {
   this.disabled = +this.value > diff;
});

:-)

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Aug 26, 2009, at 3:42 PM, Brett DeWoody wrote:



I have a function which is executed whenever someone clicks a checkbox
on the page.  There are lots of checkboxes on the page.  I want the
function to be performed on only the unchecked boxes.  I've tried this
two ways, neither of which has worked.  Here are the two methods I've
tried.

Method #1
$(".item input:unchecked").each(
function() {
 if ($(this).val() > diff) {
$(this).attr('disabled', true);
  } else {
$(this).removeAttr('disabled');
 }
}
);

Method #2
$(".item input").each(
function() {
 if ($(this).is(":unchecked")) {
if ($(this).val() > diff) {
$(this).attr('disabled', true);
} else {
$(this).removeAttr('disabled');
}
   }
}
);

Where diff is an integer and the values of the checkboxes are all
integers.  The problem is the function ends up getting run on all
checkboxes, even boxes that have been checked.

Is there another way to do this?  Something I'm missing.

Thanks,

-Brett




[jQuery] Re: [autocomplete] how to clear hidden "key" field when user changes text value?

2009-08-26 Thread jero

Thanks! I was looking for this too.

On Aug 20, 1:39 pm, Jörn Zaefferer 
wrote:
> You could try this, similar to what the plugin does for the mustMatch option:
>
> $(".autocomplete").blur(function() {
>  $(this).search(function(result) {
>    if (!result) {
>      // no match found, do something, eg. clearing other fields
>    }
>  });
>
> });
>
> Jörn
>
> On Thu, Aug 13, 2009 at 5:25 PM, Billy wrote:
>
> > Hi all,
> > I'm usingautocompleteplugin, when the user types something the
> > backend responds value and key information (for instance:
>
> > John|76178
> > Mike|87252
> > Peter|87511
>
> > Using .result I'm setting the key in a hidden field in my form.
>
> > $('#autocompleteTextboxId').result(function(event, data, formatted) {
> >        if (data)
> >                $('#autocompleteHiddenValueId').val(data[1]);
> > });
>
> > But what if the user changes his mind and after choosing "John" types
> > something else in the textbox (without actually chosing a new option
> > from theautocompleteoptions) or even deletes the whole text? As
> > things are now, the data previously set in the hidden field remains
> > there. So the user might post the form thinking that his selection is
> > blank, but the system actually thinks that he selected "76178".
>
> > Is there a way to "clear" the hidden field when the user types
> > something?
>
> > I tried by setting some action to "focus" so that whenever the user
> > focuses on the textbox the hidden value is cleared but it seems that
> > after the user chooses a value in theautocompleteoptions, the plugin
> > sets focus to the text field (hence making this action execute, thus
> > clearing the hidden value everytime).
>
> > $('#autocompleteTextboxId').focus(function() {
> >        $('#autocompleteHiddenValueId').val('');
> > });
>
> > It would be cool if we had something like ".textChanged" (similar to
> > ".result" above) where we can do some action when the user changes the
> > text on the field.
>
> > Maybe some of the JS wizards here can suggest something.
>
> > Thanks.


[jQuery] Problem using PUT HTTP method with $.ajax

2009-08-26 Thread descsuit

I have to use a REST based server from a jQuery client and it requires
that I use PUT to add some XML based items to the server's data store.
I've checked the server with curl and everything works as expected.
But from the web page it's not.. using Firebug I was able to figure
out that it was only sending like the first 11 characters of my xml
string.

I've tried this using $.ajax as follows:
Code:

$.ajax({
dataType: "xml",
data: d,
success: postSave,
url: saveURL,
type: "PUT",
beforeSend: diagnoser.credManager.getAuthSetterCurrent()
});


Right before this call I check if d is what I expected (about a page
of XML) and it is. There are no errors visible in the firebug console
or Error Console. The beforeSend function (that returns functions) is
something I've used before and it works fine (it sets some special
auth stuff in the headers).

Any ideas why it's only sending "

[jQuery] Re: binding events to dynamically created divs

2009-08-26 Thread cyawman

If you have the latest version of jQuery you can try using the
"live" ( http://docs.jquery.com/Events/live ) functionality.

Change all of your click events to something like this:

$(".AddDisc").live("click", function() {...});






On Aug 26, 3:03 pm, James  wrote:
> You should read this for more 
> info:http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...
> Although you're not using AJAX to introduce the content into the DOM,
> it's still similar to what you're doing.
>
> On Aug 26, 7:35 am, batterhead  wrote:
>
>
>
> > Hi All,
>
> > I have a page with a div that contains other divs. In the outer div, I
> > have links that add new divs inside. I also have a link outside the
> > outer div that adds more of those outer divs to the page (with an
> > inner div, and the same links to add more). This works on the div that
> > is hard coded on the page, but when I use the link to add additional
> > container divs the links inside there to add more inner divs does not
> > function. I believe it has to do with binding, but I'm not certain how
> > to fix this issue. Any assistance would be appreciated.
>
> > Here is my code:
>
> > $(document).ready(function() {
>
> >         $(".AddDisc").click( function() {
> >                 discContainerDiv = " > class='trackContainer'> > div>(++)
> > (--)";
> >                 var $newDiv = 
> > $('.discContainer:last').after(discContainerDiv);
> >                 alert($newDiv.html);
> >                 return false;
> >         });
>
> >         $(".RemoveDisc").click( function() {
> >                 $('.discContainer:last').remove();
> >                 return false;
> >         });
>
> >         $(".AddTrack").click( function() {
> >                 trackContainerDiv = " > type='text'
> > class='trackInput' value='dynamic div' />";
> >                 
> > $(this).parent().parent().end().prev().after(trackContainerDiv);
> >                 return false;
> >         });
>
> >         $(".RemoveTrack").click( function() {
> >                 $(this).parent().parents(".trackDiv").end().prev().remove();
> >                 return false;
> >         });
>
> > });
>
> > And the HTML:
>
> > 
> > 
> > 
> > 
>
> > 
> > (++)
> > (--)
> > 
> > 
> > 
> > (++)
> > (--)- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Event Not Triggering On External JS Files

2009-08-26 Thread Meroe

How about a simple alert statement to see if that is even triggering.  If
not, do you use firebug?  I would load it up and see if anything is missing
or what the actual error is.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Greg
Sent: Wednesday, August 26, 2009 12:00 AM
To: jQuery (English)
Subject: [jQuery] Re: Event Not Triggering On External JS Files


@Meroe:  That was kind of pseudo-code so I checked anyway and there's
no spaces in the actual code.

@James:  No, it doesn't work if I put the jQuery script tag in the
head.

I was wondering if it had something to do with preventing XSS?  There
is an ajax call to the button.js's domain (which could be the reason).

On Aug 25, 9:44 pm, James  wrote:
> Does it work if you put your jquery library at the top? (In the
> )
>
> On Aug 25, 12:31 pm, Greg  wrote:
>
> > I built a small JavaScript file that does some HTML and CSS
> > manipulation when you hover over any tag with a certain class.  It
> > works great when running on the same server, but if I try to use the
> > JS as an external script, the hover event isn't triggering.
>
> > Here is my external JS file code:
>
> > $(document).ready(function() {
> >   alert('i work inside');
> >   $(".start").hover(
> >     function (e) {
> >             $(".button").css( { 'display':'none', 'position':'relative',
> > 'left':'150px', 'top':'-10' } );
> >             $(".button").fadeIn(500);
> >         },
> >         function (e) {
> >           $(".button").remove();
> >         });});
>
> > alert('i work outside');
>
> > Here is my include code on the HTML page:
> > 
> >   Yes
> > 
> > http://ajax.googleapis.com/ajax/
> > libs/jquery/1.3.2/jquery.min.js">
> > http://mydomain.com/js/
> > button.js">
>
> > When I hover over that span, it does not trigger the code in
> > "button.js",  Any ideas?
>
> > Thanks in advance.



[jQuery] [hoverIntent]Simple Dropdown Menu (not quite so simple apparently)

2009-08-26 Thread Zaliek

I've built some CSS dropdown menus which work properly on their own:


Dual Sport

Dual Sport 
Kits
Lighting 
Stators
Vapor 
Speedo/Tach
Fuel Tanks




 is the hover trigger element
 is the dropdown element which is toggled between
display:none and display:block

For the sake of IE6 users, and to improve usability I'm adding in a
simple (or so I thought) call to hoverIntent to show and hide the
menus. Problem is I can't get it to actually do anything.

Here is my current code:
$(document).ready(function(){
$("li.menu-link").hoverIntent(function(){$(this).children
('ul.dropdown').fadeIn('500');},function(){$(this).children
('ul.dropdown').fadeOut('500');});
});

I'm not getting any errors so I can't tell what exactly is wrong here.
Anyone have any ideas? Or is my approach wrong?

Thanks in advance for any replies.


[jQuery] Re: Form Plugin issue

2009-08-26 Thread Lay András

Hello!

On Wed, Aug 26, 2009 at 9:04 PM, Mike Alsup wrote:

> Kostya is correct.  Try embedding the response in a textarea element -
> the plugin will automatically extract if for you and no escaping is
> needed.

This don't works, because response embedding in a textarea only needs,
if the response type script, or JSON. In my example, the response type
is HTML.

Lay


[jQuery] Re: syntax problems

2009-08-26 Thread holicGirl

Yes I'm using 1.3.2 and I didn't know that @ was already deprecated

in the previous version.

thank you:-)

On 26 Ago, 20:56, MorningZ  wrote:
> If you are using 1.3.2 of the library, then lose the "@"
>
> is there any reason why you just don't say
>
> jQuery("a#myLink")
>
> since you can't use "$" ?
>
> On Aug 26, 11:40 am, holicGirl  wrote:
>
> > Hello,
> > I have a basic knowlegde of jQuery and a problem in selecting a link.
> > To be specific I've a problem with the syntax.
>
> > I'm using several libraries so I can't use for example the $
> > ('a#myLink') function but I've to write jq('a...@id="myLink"]').
>
> > The application don't recognize the syntax, it shows this message:
> >          Syntax error, unrecognized expression: [...@id="myLink"]
>
> > Can someone help me?
>
> > Thanks in advance


[jQuery] Re: syntax problems

2009-08-26 Thread holicGirl

Yes you're rigth, i didn't know @ was already deprecated in the
previous version and

completely removed from the last one.

Thank you very much :-)

On 26 Ago, 22:25, Michael Lawson  wrote:
> If you are using the most recent version of jQuery, the @ notation is no
> longer used.  Try removing it and see what happens.
>
> cheers
>
> Michael Lawson
> Development Lead, Global Solutions, ibm.com
> Phone:  1-276-206-8393
> E-mail:  mjlaw...@us.ibm.com
>
> 'Whether one believes in a religion or not,
> and whether one believes in rebirth or not,
> there isn't anyone who doesn't appreciate kindness and compassion..'
>
>   From:       holicGirl                           
>                                                   
>
>   To:         "jQuery (English)"                  
>                                                    
>
>   Date:       08/26/2009 04:20 PM                                             
>                                                    
>
>   Subject:    [jQuery] syntax problems                                        
>                                                   
>
> Hello,
> I have a basic knowlegde of jQuery and a problem in selecting a link.
> To be specific I've a problem with the syntax.
>
> I'm using several libraries so I can't use for example the $
> ('a#myLink') function but I've to write jq('a...@id="myLink"]').
>
> The application don't recognize the syntax, it shows this message:
>          Syntax error, unrecognized expression: [...@id="myLink"]
>
> Can someone help me?
>
> Thanks in advance
>
>  graycol.gif
> < 1KVisualizzaScarica
>
>  ecblank.gif
> < 1KVisualizzaScarica


[jQuery] Re: How to express the AND condition in jQuery

2009-08-26 Thread John

Ok, I created a custom selector by following some guide from some
blogs,

  $.expr[':'].myselector = function(obj, index, m){
  var $this = $(obj);

  var splitted = m[3].split(",");
  var result = true;

  for(var i=0; i 0);
  }

  return result;
   };

it seems working. But is there any better way to get back the input
array other than use "split"?

Thanks,

John

On Aug 26, 2:48 pm, John  wrote:
> Variable input variables are even better than an array.
>
> Thanks,
>
> John
>
> On Aug 26, 2:23 pm, John  wrote:
>
> > Cool. It works. Thanks again.
>
> > I am a beginner of jQuery and need further help on this. Practically,
> > I will have variable number of inputs to do the and operation. That is
> > to say, I need to pass in an array to the myselector plugin apart from
> > the object, how to achieve that?
>
> > Thanks in advance,
>
> > John
>
> > On Aug 26, 1:25 pm, John  wrote:
>
> > > Thanks, will try.
>
> > > Does that mean that the ":has" operator is not designed for the AND
> > > operation?
>
> > > Thanks,
>
> > > John
>
> > > On Aug 26, 12:52 pm, MorningZ  wrote:
>
> > > > Not sure if this is the only or best way or how "fast" it may or may
> > > > not be, but does work
>
> > > >http://paste.pocoo.org/show/136392/
>
> > > > On Aug 26, 12:32 pm, John  wrote:
>
> > > > > Hi,
>
> > > > > If I like to find a "div" with children "input", "img", and "span",
> > > > > how to express the selector:
>
> > > > >  the div that has children of an "input" tag, an "img" tag, and  a
> > > > > "span" tag"
>
> > > > > in jQuery?
>
> > > > > Seems the jQuery ":has" can do the job, but I am not really sure if
> > > > > that is the correct way.
> > > > > Any insight on this is appreciated.
>
> > > > > Thanks in advance,
>
> > > > > John


[jQuery] Re: empty() is very slow

2009-08-26 Thread oleOhle

OK, thanks everybody! I think I understand.

Actually my second attempt could easily be rewritten to match exactly
what jQuery does. It really boils down to the remove() function, which
does some magic to remove data and events related to the contained DOM
elements. Since I only have one HTML onClick event handler defined on
one of the elements and do not use the jQuery event system, I hope
that I'm fine with using the suggestion of setting the innerHTML to ''.


[jQuery] Re: Looping through all unchecked checkboxes - how to do it?

2009-08-26 Thread elubin

I don't believe there is an :unchecked selected.  I think you
want :not:checked



On Aug 26, 3:42 pm, Brett DeWoody  wrote:
> I have a function which is executed whenever someone clicks a checkbox
> on the page.  There are lots of checkboxes on the page.  I want the
> function to be performed on only the unchecked boxes.  I've tried this
> two ways, neither of which has worked.  Here are the two methods I've
> tried.
>
> Method #1
> $(".item input:unchecked").each(
>      function() {
>           if ($(this).val() > diff) {
>                 $(this).attr('disabled', true);
>           } else {
>                 $(this).removeAttr('disabled');
>          }
>      }
> );
>
> Method #2
> $(".item input").each(
>      function() {
>           if ($(this).is(":unchecked")) {
>                 if ($(this).val() > diff) {
>                         $(this).attr('disabled', true);
>                 } else {
>                         $(this).removeAttr('disabled');
>                 }
>            }
>      }
> );
>
> Where diff is an integer and the values of the checkboxes are all
> integers.  The problem is the function ends up getting run on all
> checkboxes, even boxes that have been checked.
>
> Is there another way to do this?  Something I'm missing.
>
> Thanks,
>
> -Brett


[jQuery] Re: jquery.corner.js plugin not working with elements

2009-08-26 Thread Noel Weichbrodt

Thanks for the initial reply Leonardo and the canonical reply Mike.

--Noel

On Aug 26, 1:58 pm, Mike Alsup  wrote:
> > I think you can't rounded a input element with this plugin. U can put the
> > input inside a div element, round the div and set border=0 to your input. So
> > the user think the input is rounded, but actualy is the div outside.
>
> Leonardo is correct, this plugin will not work on input elements.


[jQuery] Re: Looping through all unchecked checkboxes - how to do it?

2009-08-26 Thread James

It sounds like it's your selector that's incorrect. Could you post how
your HTML looks like?


On Aug 26, 9:42 am, Brett DeWoody  wrote:
> I have a function which is executed whenever someone clicks a checkbox
> on the page.  There are lots of checkboxes on the page.  I want the
> function to be performed on only the unchecked boxes.  I've tried this
> two ways, neither of which has worked.  Here are the two methods I've
> tried.
>
> Method #1
> $(".item input:unchecked").each(
>      function() {
>           if ($(this).val() > diff) {
>                 $(this).attr('disabled', true);
>           } else {
>                 $(this).removeAttr('disabled');
>          }
>      }
> );
>
> Method #2
> $(".item input").each(
>      function() {
>           if ($(this).is(":unchecked")) {
>                 if ($(this).val() > diff) {
>                         $(this).attr('disabled', true);
>                 } else {
>                         $(this).removeAttr('disabled');
>                 }
>            }
>      }
> );
>
> Where diff is an integer and the values of the checkboxes are all
> integers.  The problem is the function ends up getting run on all
> checkboxes, even boxes that have been checked.
>
> Is there another way to do this?  Something I'm missing.
>
> Thanks,
>
> -Brett


[jQuery] Re: Same classes div problem

2009-08-26 Thread Michael Geary

Yes, $(context).find(selector) is highly recommended over
$(selector,context).

It's much more understandable and it's a tiny bit faster too.

Jose, some background: When you used $(".product-right .hidden") you were
selecting *all* .product-right elements and then finding the .hidden
elements inside them.

In your mouseover callback function, 'this' holds a reference to the
specific element that received the event. That's why $(this).find('.hidden')
does what you want.

-Mike

> From: James
> 
> Or:
> 
> $(".product-right").mouseover(function() {
> $(this).find(".hidden").show();
> });
> 
> On Aug 26, 11:03 am, James  wrote:
> >         $(".product-right").mouseover(function() {
> >                 $(".hidden", this).show();
> >         });
> >
> > On Aug 26, 9:45 am, Jose  wrote:
> >
> > > Hey everyone,
> >
> > > So I have a set of divs all with the same class name, all 
> of these 
> > > divs have a hidden div inside of them with the class name "hidden"
> >
> > > I wrote this and it seemed to work, except ALL hidden divs show 
> > > instead of the one being hovered:
> >
> > >         $(".product-right").mouseover(function() {
> > >                 $(".product-right .hidden").show();
> > >         });
> >
> > > I want only the div that is being hovered to show its hidden div, 
> > > unique IDs are sort of not a possibility so I was 
> wondering if there 
> > > was anyway to do it with jquery?
> >
> > > Thanks
> >
> > > Jose
> >
> >
> 



[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread James

As Paolo mentioned, despite how it looks in a browser's source, the
internal representation within the DOM may be different depending on
the browser.
In one browser it could be:
overflow: auto; width: 356px; height: 100px;

in another it could be:
overflow:auto; width:356px; height:100px;

in another it could be:
overflow:auto;width:356px;height:100px;

There's got to be a better way to achieve what you want to do. Since
we have no idea what you're trying to do, maybe you could explain it
as to what the rhyme or reason to the selection sets you're trying to
select is.
Looking at the code you've provided, is it possible to use the ID in
anyway? You could do selections with conditions like "if ID begins
with 'ext-gen'" and other conditions along with that. As long as
you're not trying to read the style string.


On Aug 26, 4:06 am, John  wrote:
> Thanks.
>
> Here is the html source,
>
>   style="padding-left: 130px;">
>         
>              value=""/>
>                                 size="24" readonly="true" style="width: 343px;"/>
>              src="images/s.gif"/>
>         
>     
>
> The style in the jQuery selector should match the one defined in the
> html source. I wonder if I
> did any other thing wrong here.
>
> Thanks,
>
> John
> On Aug 26, 6:45 am, Paolo Chiodi  wrote:
>
> > Maybe that that the style attribute value should be exactly equal to
> > the one contained in html. I think style="A:B C:D" doesn't match
> > style="C:D A:B".
> > May also be that the browser has an internal rapresentation of the
> > style attribute slightly different from the one written in the html
> > (never tried to see with firebug some differen orders?).
>
> > Otherwise if you create the style attribute by using .css('A','B'),
> > you can't be sure of what the entire style attribute could be.
>
> > Paolo
>
> > On Tue, Aug 25, 2009 at 11:22 PM, John wrote:
>
> > > Thanks Maurício for your quick response.
>
> > > I have a program to automatically generate jQuery selectors based on
> > > some UI element attributes and seems your syntax is not always
> > > working. For example,
>
> > > 1) working:  $('div:has(input[type=text][readonly=true], img
> > > [style="overflow: auto; width: 356px; height: 100px;"]) img')
>
> > > 2) Not working: $('div:has(input[type=text][readonly=true]
> > > [style="width: 343px;"], img[style="overflow: auto; width: 356px;
> > > height: 100px;"]) img')
>
> > > 3) Not working:  $('div:has(input[type=text][readonly=true], img
> > > [style="overflow: auto; width: 356px; height: 100px;"]) img
> > > [style="overflow: auto; width: 356px; height: 100px;"]')
>
> > > 4) Not working:  $('div:has(input[type=text][readonly=true]
> > > [style="width: 343px;"], img[style="overflow: auto; width: 356px;
> > > height: 100px;"]) img[style="overflow: auto; width: 356px; height:
> > > 100px;"]')
>
> > > Here "not working" means it returns empty object where it should
> > > return non-empty object.
>
> > > Do you know what is wrong?
>
> > > Thanks again,
>
> > > John
>
> > > On Aug 25, 2:50 pm, "Mauricio \(Maujor\) Samy Silva"
> > >  wrote:
> > >> Sintax for the selector is:
>
> > >> $('img[style="overflow: auto; width: 356px; height: 100px;"]')
>
> > >> Maurício
> > >>   -Mensagem Original-
> > >>   De: John
> > >>   Para: jQuery (English)
> > >>   Enviada em: terça-feira, 25 de agosto de 2009 14:36
> > >>   Assunto: [jQuery] jQuery selector for style attribute
>
> > >>   Hi,
>
> > >>   I want to select the following image using jQuery selector to see if I
> > >>   could use the style attribute,
>
> > >>    > >>   style="overflow: auto; width: 356px; height: 100px;" src="images/
> > >>   s.gif"/>
>
> > >>   but seems the selector
>
> > >>   img[style=overflow: auto; width: 356px; height: 100px;]
>
> > >>   does not work at all. What would be the correct selector for the style
> > >>   attribute?
>
> > >>   Thanks in advance,
>
> > >>   John
>
>


[jQuery] Re: .load() doesn't work on first call in FF3 and IE (But works in FF3.5)?

2009-08-26 Thread D A

> Looks like a case of "asynchronous-itis". You're reading the val() of
> the load()-ed div before the Ajax call has had a chance to respond.
>
> What you'll want to do is add the fancyBox stuff to the callback
> function for load() like this:

Leonard:

Thanks! You *were* on the right track with that advice. That was
definitely part of the issue.

The other issue was that we were trying to trigger two events
(FancyBox and .load()) on one DOM element.

The fix was a combination of your suggestion, and adding a second HTML
element that gets triggered from the first elements event.

HTML:



jQuery:

$('#fancyBoxTrigger').fancybox({
'hideOnContentClick': false,
frameWidth: 660,
frameHeight: 700,
overlayOpacity: .6,
padding: 0
});

$('#loadTrigger').click(function(){

$('#loadedContent').load('page.php',{'zip':$('#zip').val()},function(){$('#fancyBoxTrigger').click()});
});

Whew!

-DA


[jQuery] Re: Same classes div problem

2009-08-26 Thread James

Or:

$(".product-right").mouseover(function() {
$(this).find(".hidden").show();
});

On Aug 26, 11:03 am, James  wrote:
>         $(".product-right").mouseover(function() {
>                 $(".hidden", this).show();
>         });
>
> On Aug 26, 9:45 am, Jose  wrote:
>
> > Hey everyone,
>
> > So I have a set of divs all with the same class name, all of these
> > divs have a hidden div inside of them with the class name "hidden"
>
> > I wrote this and it seemed to work, except ALL hidden divs show
> > instead of the one being hovered:
>
> >         $(".product-right").mouseover(function() {
> >                 $(".product-right .hidden").show();
> >         });
>
> > I want only the div that is being hovered to show its hidden div,
> > unique IDs are sort of not a possibility so I was wondering if there
> > was anyway to do it with jquery?
>
> > Thanks
>
> > Jose
>
>


[jQuery] Re: Same classes div problem

2009-08-26 Thread James

$(".product-right").mouseover(function() {
$(".hidden", this).show();
});

On Aug 26, 9:45 am, Jose  wrote:
> Hey everyone,
>
> So I have a set of divs all with the same class name, all of these
> divs have a hidden div inside of them with the class name "hidden"
>
> I wrote this and it seemed to work, except ALL hidden divs show
> instead of the one being hovered:
>
>         $(".product-right").mouseover(function() {
>                 $(".product-right .hidden").show();
>         });
>
> I want only the div that is being hovered to show its hidden div,
> unique IDs are sort of not a possibility so I was wondering if there
> was anyway to do it with jquery?
>
> Thanks
>
> Jose


[jQuery] Same classes div problem

2009-08-26 Thread Jose

Hey everyone,

So I have a set of divs all with the same class name, all of these
divs have a hidden div inside of them with the class name "hidden"

I wrote this and it seemed to work, except ALL hidden divs show
instead of the one being hovered:

$(".product-right").mouseover(function() {
$(".product-right .hidden").show();
});

I want only the div that is being hovered to show its hidden div,
unique IDs are sort of not a possibility so I was wondering if there
was anyway to do it with jquery?

Thanks

Jose


[jQuery] Looping through all unchecked checkboxes - how to do it?

2009-08-26 Thread Brett DeWoody

I have a function which is executed whenever someone clicks a checkbox
on the page.  There are lots of checkboxes on the page.  I want the
function to be performed on only the unchecked boxes.  I've tried this
two ways, neither of which has worked.  Here are the two methods I've
tried.

Method #1
$(".item input:unchecked").each(
 function() {
  if ($(this).val() > diff) {
$(this).attr('disabled', true);
  } else {
$(this).removeAttr('disabled');
 }
 }
);

Method #2
$(".item input").each(
 function() {
  if ($(this).is(":unchecked")) {
if ($(this).val() > diff) {
$(this).attr('disabled', true);
} else {
$(this).removeAttr('disabled');
}
   }
 }
);

Where diff is an integer and the values of the checkboxes are all
integers.  The problem is the function ends up getting run on all
checkboxes, even boxes that have been checked.

Is there another way to do this?  Something I'm missing.

Thanks,

-Brett


[jQuery] Re: jquery.corner.js plugin not working with elements

2009-08-26 Thread Mike Alsup

> I think you can't rounded a input element with this plugin. U can put the
> input inside a div element, round the div and set border=0 to your input. So
> the user think the input is rounded, but actualy is the div outside.

Leonardo is correct, this plugin will not work on input elements.


[jQuery] Re: How to express the AND condition in jQuery

2009-08-26 Thread John

Variable input variables are even better than an array.

Thanks,

John

On Aug 26, 2:23 pm, John  wrote:
> Cool. It works. Thanks again.
>
> I am a beginner of jQuery and need further help on this. Practically,
> I will have variable number of inputs to do the and operation. That is
> to say, I need to pass in an array to the myselector plugin apart from
> the object, how to achieve that?
>
> Thanks in advance,
>
> John
>
> On Aug 26, 1:25 pm, John  wrote:
>
> > Thanks, will try.
>
> > Does that mean that the ":has" operator is not designed for the AND
> > operation?
>
> > Thanks,
>
> > John
>
> > On Aug 26, 12:52 pm, MorningZ  wrote:
>
> > > Not sure if this is the only or best way or how "fast" it may or may
> > > not be, but does work
>
> > >http://paste.pocoo.org/show/136392/
>
> > > On Aug 26, 12:32 pm, John  wrote:
>
> > > > Hi,
>
> > > > If I like to find a "div" with children "input", "img", and "span",
> > > > how to express the selector:
>
> > > >  the div that has children of an "input" tag, an "img" tag, and  a
> > > > "span" tag"
>
> > > > in jQuery?
>
> > > > Seems the jQuery ":has" can do the job, but I am not really sure if
> > > > that is the correct way.
> > > > Any insight on this is appreciated.
>
> > > > Thanks in advance,
>
> > > > John


[jQuery] binding events to dynamically created divs

2009-08-26 Thread batterhead

Hi All,

I have a page with a div that contains other divs. In the outer div, I
have links that add new divs inside. I also have a link outside the
outer div that adds more of those outer divs to the page (with an
inner div, and the same links to add more). This works on the div that
is hard coded on the page, but when I use the link to add additional
container divs the links inside there to add more inner divs does not
function. I believe it has to do with binding, but I'm not certain how
to fix this issue. Any assistance would be appreciated.

Here is my code:

$(document).ready(function() {

$(".AddDisc").click( function() {
discContainerDiv = "(++)
(--)";
var $newDiv = $('.discContainer:last').after(discContainerDiv);
alert($newDiv.html);
return false;
});

$(".RemoveDisc").click( function() {
$('.discContainer:last').remove();
return false;
});

$(".AddTrack").click( function() {
trackContainerDiv = "";
$(this).parent().parent().end().prev().after(trackContainerDiv);
return false;
});

$(".RemoveTrack").click( function() {
$(this).parent().parents(".trackDiv").end().prev().remove();
return false;
});
});

And the HTML:







(++)
(--)



(++)
(--)


[jQuery] Re: App like hangman

2009-08-26 Thread Boris Trivic

Well, maybe you don't understand whats the problem, so here is
screenshot:

http://caraudio-rs.info/snapshot1.png

Do you think it's the bug or my mistake?


On Aug 25, 1:08 pm, Boris Trivic  wrote:
> omg!
> I just opened it in Opera (Linux) and there is some kind of bug or
> what? Instead revert to original location, chars returns about
> 100-150px right... Can someone take a look and check if same problem
> occurs?
>
> Maybe I shoult report it to jQuery dev team?
>
> On Aug 25, 7:00 pm, Boris Trivic  wrote:
>
> > Yeah, sure, it imposible to convert object to string, object has
> > methods and properties for that what I want.
> > Wheathever, thanks a lot Brett one more time, you saved me.
>
> > I finished a main part of project, there is still some little stufs to
> > fix and correct. You can take a look on next link, if you want:
>
> >http://caraudio-rs.info/nal_7/
>
> > On Aug 25, 12:17 am, Brett Ritter  wrote:
>
> > > On Mon, Aug 24, 2009 at 11:24 AM, Boris Trivic wrote:
> > > > I can success print ui.draggable to console, but how to convert it to
> > > > string?
> > > > I need to write it into some element with .innerHTML and I will
> > > > probably use it in "for" loop...
>
> > > I think you are trying the hard way.
>
> > > ui.draggable is not a string, but a jQuery element.  Use that as you see 
> > > fit.
>
> > > For Hangman you're probably looking to copy either the text  (
> > > ui.draggable.text() ) or the html itself ( ui.draggable.html() ).  If
> > > you need to clone the source you want ui.draggable.clone() (note that
> > > any events bound to the original are not bound to the clone unless you
> > > use live() )
>
> > > Trying to convert a jQuery element to a string doesn't make sense
> > > unless you say what "string" you want - the text, the html, the id,
> > > these are all different strings.
>
> > > --
> > > Brett Ritter / SwiftOne
> > > swift...@swiftone.org


[jQuery] Re: App like hangman

2009-08-26 Thread Boris Trivic

http://caraudio-rs.info/snapshot1.png

On Aug 26, 8:15 pm, Boris Trivic  wrote:
> Well, maybe you don't understand whats the problem, so here is
> screenshot:
>
> Do you think it's the bug or my mistake?


[jQuery] Re: empty() is very slow

2009-08-26 Thread MorningZ

"What is jQuery doing to empty an element?"

That's so easy to see/find-out for yourself

open up the jquery.js file, search for "emtpy" and voila

 empty: function() {
// Remove element nodes and prevent memory leaks
jQuery(this).children().remove();

// Remove any remaining nodes
while (this.firstChild)
this.removeChild(this.firstChild);
}


"2. Are there any rules when not to use jQuery for certain DOM tasks
but better to resort to direct DOM manipulation as in the example
above? "

One option that I've seen recommended a lot is to set the ".innerHTML"
of the DOM object to empty string.  i remember that it's fast, but
I can't remember if there were downsides to using that instead



On Aug 26, 2:32 pm, oleOhle  wrote:
> While writing my first jQuery application I encountered a performance
> issue whichs casts doubts on the suitability of jQuery for my purposes
> in general.
>
> The "issue": In my page I have a dynamically filled  which in the
> end contains about 10 elements, one of which is a table with 1000
> rows. Now when I try to clear that  with a simple function like
>
> function clearContainer() {
>     $('#' + Container_ID).empty();
>
> }
>
> this will take forever, i.e. one faster machine  a few seconds, on my
> netbook it even leads to javascript timeout errors.
>
> Rewriting the function to
>
> function clearContainer() {
>     var containerNode = document.getElementById(Container_ID);
>     while(containerNode.hasChildNodes()) {
>         containerNode.removeChild(containerNode.lastChild);
>     }
>
> }
>
> fixes the perfomance issue, the  is cleared almost immediately.
>
> Two questions remain:
> 1. How can the results be explained? What is jQuery doing to empty an
> element?
> 2. Are there any rules when not to use jQuery for certain DOM tasks
> but better to resort to direct DOM manipulation as in the example
> above?


[jQuery] Re: how to multiple images slideshow with jquery cycle plugin

2009-08-26 Thread Mike Alsup

> I'm looking for a same kind of solution.
> Sliding rows of 3 images at the same time.
> 9 visible images in 3 rows (1-3) (4-6) (7-9).
> Next slide will hide (1-3) and who (10-12).
>
> Anyone know how to do that?
>


The way to do that with Cycle is to group the sets of images inside
divs and treat the divs as slides.  For example:




















[jQuery] Re: how to get back the DOM element as HTML source

2009-08-26 Thread John

Cool. Thanks.  -John

On Aug 21, 9:49 am, KeeganWatkins  wrote:
> i wrote a really simple plugin for this, as i frequently have the same
> use case:
>
> jQuery.fn.outerHTML = function() {
>     return jQuery("").append( jQuery(this[0]).clone() ).html();
>
> }
>
> so that i could call it on any element, such as:
>
> $("#fooID").outerHTML();
>
> On Aug 19, 9:55 am,John wrote:
>
> > That works. Really appreciate your help. -John
>
> > On Aug 18, 7:48 pm, mkmanning  wrote:
>
> > > outerHTML is an IE addition to the DOM and not supported by Firefox.
> > > If you want to get it with jQuery just append the element to a div and
> > > get itshtml():
>
> > > $('').append( $("table:first").clone() ).html()
>
> > > On Aug 18, 4:37 pm, Jules  wrote:
>
> > > > Use DHTML property.
>
> > > > $("table:first")[0].outerHTML
>
> > > > On Aug 19, 12:36 am,John wrote:
>
> > > > > Thanks, Anurag. Let me rephrase my question. For example, I can use
> > > > > the following jQuery
> > > > > to get thehtmlsourceof a table element
>
> > > > > $("table:first").html()
>
> > > > > The returnedhtmlsourcedoes not include the table itself, I like to
> > > > > see thehtmlsourcestarting
> > > > > from the table, for example,
>
> > > > > 
> > > > > ..
> > > > > 
>
> > > > > Is there any jQuery function for this? If not, how do I implement
> > > > > this?
>
> > > > > Thanks in advance,
>
> > > > >John
> > > > > On Aug 18, 2:06 am, anurag pal  wrote:
>
> > > > > > HiJohn,
>
> > > > > > After setting thehtmlby usinghtmlmethod you have to bind the DOM
> > > > > > elements using bind method.
>
> > > > > > Example:
> > > > > > 
> > > > > >     $(".pge").bind("click", function(e){
> > > > > >         var options = {};
> > > > > >           $.ajax({
> > > > > >                     url: "data_retrieval.php",
> > > > > >                     cache: false,
> > > > > >                     type: "GET",
> > > > > >                       data: ({id : this.getAttribute('id')}),
>
> > > > > >                     success: function(html){
> > > > > >                         $("#slacker_detail_view").html(html);
> > > > > >                         $('#slacker_detail_view').show('blind', 
> > > > > > options,
> > > > > > 1500);
> > > > > >                     }
> > > > > >                 });
> > > > > >         });
> > > > > > 
>
> > > > > > Regards,
> > > > > > Anurag Pal
>
> > > > > > On Tue, Aug 18, 2009 at 7:40 AM,John 
> > > > > > wrote:
>
> > > > > > > Hi,
>
> > > > > > > How do I get back the DOM element asHTMLsourceusing jQuery? 
> > > > > > > Thehtml
> > > > > > > () method only returns the innerHTML and it does not include the 
> > > > > > > UI
> > > > > > > element itself. But I am more interested in converting the UI 
> > > > > > > element
> > > > > > > itself toHTML.
>
> > > > > > > Thanks in advance,
>
> > > > > > > Jian


[jQuery] Re: not able to append new tag in XML in IE

2009-08-26 Thread Paolo Chiodi

Maybe not the best solution, but here's something that work:

var new_element = xmlData.get(0).createElement('new_element_name');
xmlData.find('your_query').append(new_element);

On Wed, Aug 26, 2009 at 1:49 PM, g...@iec wrote:
>
> In ajax call, i set dataType as 'xml' and on success, i call a
> function in which i am passing xml which i got as response.
> And in the function i a assigning  that data to a global variable so
> that i can access it from any function.
> I am assigning it to a global variable as shown below :
> xyz : function(data){
>  xmlData = $(data);
>  .
> 
> }
> like this and then i need to modify xmldata if there is any change in
> form and on submit of form, i am sending xmlData back to server using
> ajax call.
>
> So please guide me accordingly to modify xml in global variable on
> change in form data from any other function.
>
> On Aug 26, 3:47 pm, Paolo Chiodi  wrote:
>> You don't have to use xmlData, which is the jquery object, but data
>> which is the xml dom (if you set xml as type of the request)
>>
>> Paolo
>>
>> On Wed, Aug 26, 2009 at 12:35 PM, g...@iec wrote:
>>
>> > Thanks for your reply.
>> > But this is not working.The data which i got as a result from ajax
>> > call on success, i stored it in a global variable.
>> > Like this
>> > var xmlData = $(data);
>> > But when i was executing like you told, it is not creating an
>> > element.
>>
>> > On Aug 26, 1:49 pm, Paolo Chiodi  wrote:
>> >> when you do document.createElement you create an element that is child
>> >> of "document" document.
>> >> Try to create the element with data.createElement.
>>
>> >> Paolo
>>
>> >> On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote:
>>
>> >> > I am making an ajax call and in response, i am getting an XML.
>> >> > And then using data from XML, i am creating a form.
>> >> > I stored response XMl in a variable like this
>> >> >  var xmlData  = $(data);
>> >> > If there is any change in any field of  form then i am changing
>> >> > corresponding node value in xmlData
>> >> > by appending new node in related node like this :
>> >> >  var val = document.createElement('{nodename}');
>> >> > $(val).text({changed value});
>> >> > $({corresponding node}).append($(val));
>>
>> >> > This is working fine in FF but not working in IE.
>>
>> >> > Kindly guide me how can i solve this problem.
>>
>> >> > Thanks in advance to all for providing guidance.


[jQuery] Re: How to express the AND condition in jQuery

2009-08-26 Thread John

Cool. It works. Thanks again.

I am a beginner of jQuery and need further help on this. Practically,
I will have variable number of inputs to do the and operation. That is
to say, I need to pass in an array to the myselector plugin apart from
the object, how to achieve that?

Thanks in advance,

John

On Aug 26, 1:25 pm, John  wrote:
> Thanks, will try.
>
> Does that mean that the ":has" operator is not designed for the AND
> operation?
>
> Thanks,
>
> John
>
> On Aug 26, 12:52 pm, MorningZ  wrote:
>
> > Not sure if this is the only or best way or how "fast" it may or may
> > not be, but does work
>
> >http://paste.pocoo.org/show/136392/
>
> > On Aug 26, 12:32 pm, John  wrote:
>
> > > Hi,
>
> > > If I like to find a "div" with children "input", "img", and "span",
> > > how to express the selector:
>
> > >  the div that has children of an "input" tag, an "img" tag, and  a
> > > "span" tag"
>
> > > in jQuery?
>
> > > Seems the jQuery ":has" can do the job, but I am not really sure if
> > > that is the correct way.
> > > Any insight on this is appreciated.
>
> > > Thanks in advance,
>
> > > John


[jQuery] slide one div out left while sliding one in right

2009-08-26 Thread W. Young

I have a container div with two inner divs.  I have one inner div
visible taking up 100% of the visible area and another hidden div.  I
want the visible div to slide to the left while simultaneously sliding
the other div in from the right.  This works fine except that while
the right div is sliding in, it appears below the left div.

How can this be done?

Here is the code:






$(document).ready(function() {
$("#slide").click(function() {
$("#leftDiv").hide('slide', { direction: 'left' }, 
1000);
$("#rightDiv").show('slide', { direction: 'right' }, 
1000);
return false;
});
});




some text to slide out left


some text to slide in right







[jQuery] Re: syntax problems

2009-08-26 Thread Michael Lawson
If you are using the most recent version of jQuery, the @ notation is no
longer used.  Try removing it and see what happens.

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'



 
  From:   holicGirl 
 

 
  To: "jQuery (English)"
 

 
  Date:   08/26/2009 04:20 PM   
 

 
  Subject:[jQuery] syntax problems  
 

 






Hello,
I have a basic knowlegde of jQuery and a problem in selecting a link.
To be specific I've a problem with the syntax.

I'm using several libraries so I can't use for example the $
('a#myLink') function but I've to write jq('a...@id="myLink"]').

The application don't recognize the syntax, it shows this message:
 Syntax error, unrecognized expression: [...@id="myLink"]

Can someone help me?

Thanks in advance

<><>

[jQuery] syntax problems

2009-08-26 Thread holicGirl

Hello,
I have a basic knowlegde of jQuery and a problem in selecting a link.
To be specific I've a problem with the syntax.

I'm using several libraries so I can't use for example the $
('a#myLink') function but I've to write jq('a...@id="myLink"]').

The application don't recognize the syntax, it shows this message:
 Syntax error, unrecognized expression: [...@id="myLink"]

Can someone help me?

Thanks in advance


[jQuery] empty() is very slow

2009-08-26 Thread oleOhle

While writing my first jQuery application I encountered a performance
issue whichs casts doubts on the suitability of jQuery for my purposes
in general.

The "issue": In my page I have a dynamically filled  which in the
end contains about 10 elements, one of which is a table with 1000
rows. Now when I try to clear that  with a simple function like

function clearContainer() {
$('#' + Container_ID).empty();
}

this will take forever, i.e. one faster machine  a few seconds, on my
netbook it even leads to javascript timeout errors.

Rewriting the function to

function clearContainer() {
var containerNode = document.getElementById(Container_ID);
while(containerNode.hasChildNodes()) {
containerNode.removeChild(containerNode.lastChild);
}
}

fixes the perfomance issue, the  is cleared almost immediately.

Two questions remain:
1. How can the results be explained? What is jQuery doing to empty an
element?
2. Are there any rules when not to use jQuery for certain DOM tasks
but better to resort to direct DOM manipulation as in the example
above?




[jQuery] Re: syntax problems

2009-08-26 Thread MorningZ

If you are using 1.3.2 of the library, then lose the "@"

is there any reason why you just don't say

jQuery("a#myLink")

since you can't use "$" ?


On Aug 26, 11:40 am, holicGirl  wrote:
> Hello,
> I have a basic knowlegde of jQuery and a problem in selecting a link.
> To be specific I've a problem with the syntax.
>
> I'm using several libraries so I can't use for example the $
> ('a#myLink') function but I've to write jq('a...@id="myLink"]').
>
> The application don't recognize the syntax, it shows this message:
>          Syntax error, unrecognized expression: [...@id="myLink"]
>
> Can someone help me?
>
> Thanks in advance


[jQuery] Re: Cycle Plugin - Different Transition Effects for Pager and Auto-Advance?

2009-08-26 Thread Mike Alsup

> Is it possible to use enable different transition effects for auto-
> advance versus the pager (that is, when a user clicks a pager item)?
>
> I'd like very much to use "fade" as images auto-advance without user
> input, but use a more advanced easing effect if the user clicks an
> item in the pager.


Not currently supported.


[jQuery] Re: jQuery.sortable with block containing javascript

2009-08-26 Thread Benoit toutant
Done, thanks for help :)

2009/8/26 Richard D. Worth 

> Could you create a test page and attach to a new ticket here?
> http://dev.jqueryui.com/newticket (note: requires registration)
>
> Thanks.
>
> - Richard
>
> On Wed, Aug 26, 2009 at 2:47 AM, B3nitro  wrote:
>
>>
>> Hi,
>>
>> I'm new with jQuery and javascript framework in general, I've a
>> "little" problem with the the sortable plugin.
>>
>> The code of my page looks like this  :
>> 
>> 
>> 
>> 
>> Normal content
>> 
>> 
>>  document.write(date('d/m/Y à g:i a',1251265362));> script>