[jQuery] Re: Recursion issue with nested lists.

2009-01-23 Thread RobG



On Jan 24, 2:21 pm, Karl Swedberg  wrote:
[...]
> I wrote a plugin for this sort of thing:
>
> http://plugins.kswedberg/textchildren/
>
> interactive demo:
>
> http://plugins.kswedberg/textchildren/#demo

I think you meant to reply to the OP, or maybe GG is messing up the
thread.  For both those links I get:

  "can’t find the server 'plugins.kswedberg' "


--
Rob


[jQuery] Re: Recursion issue with nested lists.

2009-01-23 Thread Karl Swedberg


On Jan 24, 9:01 am, Nicholas  wrote:

For a short summary on my issue, all that remains is the text()
function returning the string of all the node values under the one i'm
currently working with. This is by design, but I don't want it to do
this and for the life of me cannot discover a way to exclude all the
child nodes from text()!.

The XML example:

data
more data
even more data



I've designed a recursive function to move through the list until it
reaches the end. However, the output looks like this (using the
example above):

1. data more data even more data
2. more data even more data
3. even more data

So, how can i get the text from only the node i'm currently working
with instead of the text from the current and all child nodes? I've
tried various filters and selectors but the results are always the
same, either everything or nothing.


I wrote a plugin for this sort of thing:

http://plugins.kswedberg/textchildren/

interactive demo:

http://plugins.kswedberg/textchildren/#demo

--Karl

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



[jQuery] Re: Weird Hiding Issue

2009-01-23 Thread Karl Swedberg

Hi David,

I suspect the unordered lists aren't being hidden because the browser  
will not recognize that they are within the paragraph.


Paragraphs are not allowed to have any block-level elements inside of  
them:


The P element represents a paragraph. It cannot contain block-level  
elements (including P itself).

http://www.w3.org/TR/html40/struct/text.html#h-9.3.1

When you have an invalid DOM structure, script goofiness happens.

--Karl


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




On Jan 23, 2009, at 3:46 PM, david.vansc...@gmail.com wrote:



The answer to this is probably really simple, but I'm just not finding
it.

I'm working on a newsletter and they want the first paragraph of each
article shown, then a More link at the end.  Got that working fine.  I
even have it working so that it automatically hides all but the first
paragraph tag.  Perfect.  However, I have a few unordered lists inside
paragraph tags and the unordered lists aren't hidden when the page
loads, even if they're inside the paragraph tags.  How would I get
those elements to be hidden when the paragraph tag is hidden?  Thanks!




[jQuery] Re: Recursion issue with nested lists.

2009-01-23 Thread RobG



On Jan 24, 9:01 am, Nicholas  wrote:
> For a short summary on my issue, all that remains is the text()
> function returning the string of all the node values under the one i'm
> currently working with. This is by design, but I don't want it to do
> this and for the life of me cannot discover a way to exclude all the
> child nodes from text()!.
>
> The XML example:
> 
> data
> more data
> even more data
> 
> 
>
> I've designed a recursive function to move through the list until it
> reaches the end. However, the output looks like this (using the
> example above):
>
> 1. data more data even more data
> 2. more data even more data
> 3. even more data
>
> So, how can i get the text from only the node i'm currently working
> with instead of the text from the current and all child nodes? I've
> tried various filters and selectors but the results are always the
> same, either everything or nothing.

I think you mean you want the value of the text nodes that are
children of a particular node.  Something like the following should
work:

function getNodeText(el) {
  var node, txt = [];
  for (var i=0, len=el.childNodes.length; i

[jQuery] Re: mysterious $(window).error behavior

2009-01-23 Thread Dave Methvin

> Interesting, thanks for the link. I didn't realize that was (supposed
> to be) supported.

Yeah but it is definitely broken. I noticed this last year and could
have sworn I opened a bug, but I can't find it. So I opened one now.

http://dev.jquery.com/ticket/3982



[jQuery] Re: trying to get parent frame from mouse event

2009-01-23 Thread jay

self.name

On Jan 23, 8:29 pm, jquertil  wrote:
> whats the best way to find the frame name of a click event?
>
> in FF I managed to do this:
>
> $('#'+e.view.name, top.document)
>
> but
>
> e.view.name is "undefined" in IE.


[jQuery] Re: Text Manipulation

2009-01-23 Thread jay

Something like this should work:

str = $(textinput).val();
$(textinput).val(  str.substr(0,str.indexOf("@"))  );

On Jan 23, 7:51 pm, whtthehecker  wrote:
> Hi,
>
> I'm trying to create a sign up form where after the user inputs their
> email address when they click or tab down to the next field (username
> field) it auto-populates it with their email address but with the
> "@x.xxx" section stripped from it. i.e. if the user puts
> "j...@johndoe.com" into the email field when they tab to the username
> field it will auto-populate with "john".
>
> I have achieved auto-populating the field with the email address but
> I'm not sure how to remove the "@johndoe.com" part.
>
> Thanks for any help you can provide!


[jQuery] Re: Recursion issue with nested lists.

2009-01-23 Thread jay

You could try using a regular expression to exclude xml tags.. of
course you would need something that gives more info than text().. I'm
not sure what the function is for xml.. perhaps html() or contents()
will work

On Jan 23, 6:01 pm, Nicholas  wrote:
> For a short summary on my issue, all that remains is the text()
> function returning the string of all the node values under the one i'm
> currently working with. This is by design, but I don't want it to do
> this and for the life of me cannot discover a way to exclude all the
> child nodes from text()!.
>
> The XML example:
> 
> data
> more data
> even more data
> 
> 
>
> I've designed a recursive function to move through the list until it
> reaches the end. However, the output looks like this (using the
> example above):
>
> 1. data more data even more data
> 2. more data even more data
> 3. even more data
>
> So, how can i get the text from only the node i'm currently working
> with instead of the text from the current and all child nodes? I've
> tried various filters and selectors but the results are always the
> same, either everything or nothing.
>
> Thanks,
> Nick


[jQuery] Re: sd

2009-01-23 Thread system div
what?

2009/1/24 David Meiser 

> e^pi?
>
> On Fri, Jan 23, 2009 at 8:31 PM, jquertil  wrote:
>
>>
>> sqrt
>
>
>


[jQuery] Re: UI/Accordion - Possible to deep-link?

2009-01-23 Thread jay

something like this might work:

$(document).scrollTop(getRealTop(accordian));

function getRealTop(el){
yPos = document.getElementById(el).offsetTop;
tempEl = document.getElementById(el).offsetParent;
while (tempEl != null) {
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
return yPos;
}


On Jan 23, 8:34 pm, bcbounders  wrote:
> Jörn,
>
> Thanks for the tip... looks like that could work with a navigation
> filter parsing out the anchor portion of the URL.  I'll give it a
> shot, anyway!
>
> As for the scroll-down-to-accordion part... guess I've got some more
> googling to do!  :D
>
> Thanks!
>
>  - John
>
> On Jan 23, 3:28 am, Jörn Zaefferer 
> wrote:
>
>
>
> > You can use the navigation-option for 
> > that:http://docs.jquery.com/UI/Accordion/accordion
> > Though you have to implement the "scroll down to accordion" yourself.
>
> > Jörn
>
> > On Thu, Jan 22, 2009 at 10:44 PM, bcbounders  wrote:
>
> > > Hi,
>
> > > This is probably a stupid question, but I've been scouring around
> > > trying to find an answer to no avail.
>
> > > Is is possible to have a hyperlink that links to the accordion on
> > > another page in such a way that it opens a specific accordion
> > > element?  For instance, I have a page where I want to include an
> > > accordion where each accordion element is a different service offered
> > > by my company.  On another page, I want to have a series of links,
> > > each one linking to a different element in the accordion, so that when
> > > the page is loaded, it scrolls down to that element and it is
> > > expanded.
>
> > > Is this possible?
>
> > > Thanks!
> > >  - John- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: sd

2009-01-23 Thread David Meiser
e^pi?

On Fri, Jan 23, 2009 at 8:31 PM, jquertil  wrote:

>
> sqrt


[jQuery] Re: mysterious $(window).error behavior

2009-01-23 Thread Mike Alsup

> It's certainly documented to work.  See:
>
> http://docs.jquery.com/Events/error#fn-- particularly the examples.


Interesting, thanks for the link. I didn't realize that was (supposed
to be) supported.

Mike


[jQuery] Re: UI/Accordion - Possible to deep-link?

2009-01-23 Thread bcbounders

Jörn,

Thanks for the tip... looks like that could work with a navigation
filter parsing out the anchor portion of the URL.  I'll give it a
shot, anyway!

As for the scroll-down-to-accordion part... guess I've got some more
googling to do!  :D

Thanks!

 - John

On Jan 23, 3:28 am, Jörn Zaefferer 
wrote:
> You can use the navigation-option for 
> that:http://docs.jquery.com/UI/Accordion/accordion
> Though you have to implement the "scroll down to accordion" yourself.
>
> Jörn
>
> On Thu, Jan 22, 2009 at 10:44 PM, bcbounders  wrote:
>
> > Hi,
>
> > This is probably a stupid question, but I've been scouring around
> > trying to find an answer to no avail.
>
> > Is is possible to have a hyperlink that links to the accordion on
> > another page in such a way that it opens a specific accordion
> > element?  For instance, I have a page where I want to include an
> > accordion where each accordion element is a different service offered
> > by my company.  On another page, I want to have a series of links,
> > each one linking to a different element in the accordion, so that when
> > the page is loaded, it scrolls down to that element and it is
> > expanded.
>
> > Is this possible?
>
> > Thanks!
> >  - John


[jQuery] Re: sd

2009-01-23 Thread jquertil

sqrt


[jQuery] trying to get parent frame from mouse event

2009-01-23 Thread jquertil

whats the best way to find the frame name of a click event?

in FF I managed to do this:

$('#'+e.view.name, top.document)

but

e.view.name is "undefined" in IE.


[jQuery] Re: Reload Part of a Page

2009-01-23 Thread Good Knight

Ahh, I see what you're saying.
I got it working!

Thanks!

On Jan 23, 6:37 pm, Mike Alsup  wrote:
> > Hi. I don't think that will work.
>
> > The category list that creates the UL is a PHP which 
> > statementhttp://www.pastie.org/369269
>
> > It would have to rerun that PHP script everytime the .post() is ran
> > from the initial javascript.
>
> I think Jay is making the reasonable assumption that the response from
> addCategory.php is the markup for the new list items. If so, then you
> what he suggested:
>
> $('#myList').html(data);
>
> If the response is something else, or nothing at all, then you need to
> fetch it with a GET.  How you implement it on the server is up to you,
> but the jQuery code could be as simple as this:
>
> $('#myList').load('lib/getCategory.php?category=' + catName);


[jQuery] Text Manipulation

2009-01-23 Thread whtthehecker

Hi,

I'm trying to create a sign up form where after the user inputs their
email address when they click or tab down to the next field (username
field) it auto-populates it with their email address but with the
"@x.xxx" section stripped from it. i.e. if the user puts
"j...@johndoe.com" into the email field when they tab to the username
field it will auto-populate with "john".

I have achieved auto-populating the field with the email address but
I'm not sure how to remove the "@johndoe.com" part.

Thanks for any help you can provide!


[jQuery] Re: jquery not working at all after upgrade to 1.3.1

2009-01-23 Thread Mike Alsup

> This is the same error I get when I was building the app and the id,
> gid3 in this case, did not exist on the page.  It does exist, but is
> hidden. I tried unhiding it and it didnt change anything. I can toggle
> between 1.2.6 and 1.3.1 and watch as it works, then doesn't work.
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>  language="JavaScript">
> function columnMove(order,scope){
>             var params = "";
>             if(scope != null)
>             {
>               params += "&page_scope=" + scope;
>             }
>             $.ajax({
>             type: "GET",
>             url: "",
>             data: params
>             });
>           };;
> 
> $
> (document).ready(function(){$('#gid3').flexigrid();});
>
> 
> 
>
> 


And you're including jQuery?  Are you using Firebug?  Can you set a
breakpoint and/or verify that the scripts have all loaded correctly?


[jQuery] Re: mysterious $(window).error behavior

2009-01-23 Thread Adam Fisk

It's certainly documented to work.  See:

http://docs.jquery.com/Events/error#fn -- particularly the examples.

Straight window.onerror has all sorts of cross-browser issues which I
was hoping to bypass with the jquery call.

-Adam


On Jan 23, 5:04 pm, Mike Alsup  wrote:
> > I can't seem to get $(window).error to work the way it seems like it
> > should.  Have a look at the following page:
>
> >http://www.littleshoot.org/errorTest2.html
>
> > It includes the following, and neither error is caught by the $
> > (window).error function -- the alert never happens.  Anyone know
> > what's up?
>
> >     
> >         $(document).ready( function() {
> >             $(window).error(function(msg, url, line) {
> >                 alert("Got error");
> >             });
> >             throw new Error("Inside doc ready error");
> >         });
> >         throw new Error("Outside doc ready error");
> >     
>
> > Thanks.
>
> > -Adam Fisk
>
> Hmm, I'm not sure that binding the window error event has ever been
> supported by jQuery.  I'd stick with using onerror.
>
> window.onerror = function(msg, uri, line) {
>
> }


[jQuery] Re: Bug? ajax request headers not being modified by beforeSend (jquery 1.3.1)

2009-01-23 Thread Mike Alsup

> > I need some help here guys.
> > I'm trying to modify the content-type and accept-charsetrequest
> > headers of an ajax call and it seems that beforeSend does not really
> > change the XHR object.
>
> > My code is something like this:
> >                 beforeSend : function(xhr) {
> >                         
> > xhr.setRequestHeader('Accept-Charset','windows-1253');
> >                         
> > xhr.setRequestHeader('Content-type','application/x-www-form-
> > urlencoded;charset=windows-1253')
> >                 }
>
> > I need the charset to be windows-1253 and not UTF-8, as the database
> > and everything in between (server side scripts) are encoded with
> > windows-1253.
>
> > My html page has the correct charset specified:
> >         
> >         
>
> > If I submit the form without ajax, the charset is ok and my data is
> > saved correctly. Otherwise non-latin characters are replaced with
> > weird characters. From what I understand, changing the charset &
> > encoding to UTF-8 is currently not an option.
>
> > Any suggestions? Is this a jquery bug or I'm I doing something wrong?

> It seems that when I use GET instead of POST, the content type header
> is correctly changed to what I specify.
>
> But even so, this is not a stable fix as I want to POST.
>
> Any ideas?



Hi Nicolas,

Can you post a link to a page that shows this behavior?  How are you
observing the outgoing request headers?

Mike


[jQuery] Re: mysterious $(window).error behavior

2009-01-23 Thread Mike Alsup

> I can't seem to get $(window).error to work the way it seems like it
> should.  Have a look at the following page:
>
> http://www.littleshoot.org/errorTest2.html
>
> It includes the following, and neither error is caught by the $
> (window).error function -- the alert never happens.  Anyone know
> what's up?
>
>     
>         $(document).ready( function() {
>             $(window).error(function(msg, url, line) {
>                 alert("Got error");
>             });
>             throw new Error("Inside doc ready error");
>         });
>         throw new Error("Outside doc ready error");
>     
>
> Thanks.
>
> -Adam Fisk


Hmm, I'm not sure that binding the window error event has ever been
supported by jQuery.  I'd stick with using onerror.

window.onerror = function(msg, uri, line) {
}


[jQuery] Re: Scale effect and hover

2009-01-23 Thread Mike Alsup

> Hi guys! I'm looking for a simple image hover effect, but with the
> scale effect...
> I just want make an image bigger on mouse over.

This might help:

http://www.malsup.com/jquery/hoverpulse/


[jQuery] Re: Cycle plugin an absolute positioning

2009-01-23 Thread Mike Alsup

> Ok - I got the centering thing working on FF Opera and IE7 - not tested in
> IE6 yet - but now i have another problem - the slideshow dont work when
> using with Lightbox2 - i made a test page - anyone have an idea on how to
> fix this?  http://test.ywn.no/jQuery/test

Looks to me like the slideshow is working but the Lightbox is not.
The Lightbox runs on Prototype and since you're loading jQuery after
prototype you need to use the $.noConflict().

http://docs.jquery.com/Core/jQuery.noConflict


[jQuery] Re: getJSON beforesend?

2009-01-23 Thread Mike Alsup

> now i have another question is there in getJSON some thing like the
> beforeSend function in $.ajax ???
>
> or schoult i manage my calls through the $.ajax(options) call with the
> dataType "json" ??
>
> what are your opinions
>
> thanks for your replies


If you are getting the JSON data from a different domain (via jsonp)
then no, there is no beforeSend callback.  If you are getting it from
the same domain then getJSON actually uses $.ajax under the hood so
all the same rules apply.


[jQuery] Re: Reload Part of a Page

2009-01-23 Thread Mike Alsup

> Hi. I don't think that will work.
>
> The category list that creates the UL is a PHP which 
> statementhttp://www.pastie.org/369269
>
> It would have to rerun that PHP script everytime the .post() is ran
> from the initial javascript.


I think Jay is making the reasonable assumption that the response from
addCategory.php is the markup for the new list items. If so, then you
what he suggested:

$('#myList').html(data);

If the response is something else, or nothing at all, then you need to
fetch it with a GET.  How you implement it on the server is up to you,
but the jQuery code could be as simple as this:

$('#myList').load('lib/getCategory.php?category=' + catName);


[jQuery] Re: Reload Part of a Page

2009-01-23 Thread Good Knight

Hi. I don't think that will work.

The category list that creates the UL is a PHP which statement
http://www.pastie.org/369269

It would have to rerun that PHP script everytime the .post() is ran
from the initial javascript.

On Jan 23, 4:30 pm, jay  wrote:
> just reload it with whatever is in the data variable.  $("#myUL").html
> (data) will do the trick assuming your data is just html like "1 li>2"
>
> On Jan 23, 12:46 pm, Good Knight  wrote:
>
> > Is there an easy way to reload a section of a page?
>
> > I have a .post() that updates the contents of an unordered list, but i
> > have to refresh the page to see the new contents of the UL. Anyway to
> > have the UL reload when the .post() goes off?
>
> > I am using the Impromptu plugin to run the post, but this should be
> > just a basic jQuery issue I don't think it's a plugin question.
>
> > Code can be found athttp://www.pastie.org/368851
>
> > Any ideas would be very useful!


[jQuery] getJSON beforesend?

2009-01-23 Thread Trend-King

Thanks for your good tips for the json in my multiple ajax call update
boxes question.

now i have another question is there in getJSON some thing like the
beforeSend function in $.ajax ???

or schoult i manage my calls through the $.ajax(options) call with the
dataType "json" ??

what are your opinions

thanks for your replies


[jQuery] Re: Prototype to jQuery: "current" element

2009-01-23 Thread Ricardo Tomasi

'this' in an attribute event handler refers to 'window', not the
element itself. You're better of using proper event listeners:

$('.thing a').click(function(){
   $(this).parents('.setting').remove();
});

or a function to which the event will be passed by default:

function removeSetting(event){
  $(event.target || event.srcElement).closest('.setting').remove();
};

remove

On 23 jan, 20:57, candlerb  wrote:
> I am trying to convert the following Prototype code to jQuery:
>
> 
>   ...
>   remove
> 
>
> Basically, when a user clicks on the 'remove' link I want the entire
> enclosing div which contains this link to vanish from the DOM. But
> there are multiple divs, each with their own 'remove' links. (*)
>
> With jQuery I have tried onclick="$(this).closest('.setting').remove
> ()" but it doesn't work - nothing happens. To debug I tried
> onclick="alert($(this).toSource())" and it showed me an empty object.
>
> I am sure I'm missing something obvious. When I google for this I just
> get examples where a click callback function is registered - $(this)
> is set appropriately within the callback. But here I just want to
> stick some Javascript inline in an onclick="..." handler.
>
> Many thanks,
>
> Brian.
>
> (*) Aside: original Prototype-based code taken 
> fromhttp://railscasts.com/episodes/75
> - I am migrating this app to jQuery using jRails.


[jQuery] Re: SVN for SuperFish?

2009-01-23 Thread Mike Walsh

Bump ... Joel - I see you are answering SuperFish questions again, I
posted this a few weeks ago - can you answer it?

Thanks,

Mike

On Jan 5, 11:31 am, Mike Walsh  wrote:
> I have started using SuperFish for a new project and I'd like to
> create an external SVN reference to SuperFish for the project but I
> couldn't find a repository.  Is there one?
>
> Thanks,
>
> Mike


[jQuery] Re: Blending / Transitioning two Divs together at the same time

2009-01-23 Thread Mike Alsup

> $(document).ready(function(){
>
>         $("#toggle-product-overview").click(function () {
>                 $("#is-me").fadeOut("500", function() { 
> $("#product-overview").fadeIn
> ("500"); });
>         });
>
>         $("#toggle-is-me").click(function () {
>                 $("#product-overview").fadeOut("500", function() { 
> $("#is-me").fadeIn
> ("500"); });
>         });
>
> });
>
> Is there anyway i can transition into the next div rather than fade in/
> out? Please let me know, i have looked all over the place and tried
> many different things, but haven't figured it out yet.
>
> Any help would be greatly appreciated!


Don't put the fadeIn call in the fadeOut's callback.  Just call them
consecutively:

$('#itemA').fadeOut(500);
$('#itemB').fadeIn(500);




[jQuery] Recursion issue with nested lists.

2009-01-23 Thread Nicholas

For a short summary on my issue, all that remains is the text()
function returning the string of all the node values under the one i'm
currently working with. This is by design, but I don't want it to do
this and for the life of me cannot discover a way to exclude all the
child nodes from text()!.

The XML example:

data
more data
even more data



I've designed a recursive function to move through the list until it
reaches the end. However, the output looks like this (using the
example above):

1. data more data even more data
2. more data even more data
3. even more data

So, how can i get the text from only the node i'm currently working
with instead of the text from the current and all child nodes? I've
tried various filters and selectors but the results are always the
same, either everything or nothing.


Thanks,
Nick


[jQuery] Prototype to jQuery: "current" element

2009-01-23 Thread candlerb

I am trying to convert the following Prototype code to jQuery:


  ...
  remove


Basically, when a user clicks on the 'remove' link I want the entire
enclosing div which contains this link to vanish from the DOM. But
there are multiple divs, each with their own 'remove' links. (*)

With jQuery I have tried onclick="$(this).closest('.setting').remove
()" but it doesn't work - nothing happens. To debug I tried
onclick="alert($(this).toSource())" and it showed me an empty object.

I am sure I'm missing something obvious. When I google for this I just
get examples where a click callback function is registered - $(this)
is set appropriately within the callback. But here I just want to
stick some Javascript inline in an onclick="..." handler.

Many thanks,

Brian.

(*) Aside: original Prototype-based code taken from 
http://railscasts.com/episodes/75
- I am migrating this app to jQuery using jRails.


[jQuery] Blending / Transitioning two Divs together at the same time

2009-01-23 Thread bioprez

Hello,

I am having trouble with 'blending/transitioning' two divs together.
What i would like to do is have one div transition into another div
when you click an image link, rather than have it fade out and then
fade into the next div.

I would like to have the same effect that the Cycle Lite plugin has
when it transitions between two images, but instead of images, i would
like it to be 2 div's (see here: http://malsup.com/jquery/cycle/lite/,
click on the 'next' link under click triggers heading and see how it
transitions into next image). I can't use the cycle plugin because it
doesn't support specifying which element to transition into next,
rather its more like a slideshow of consecutive elements.

Here is what i have so far, what it does is fades out and then fades
back in using a callback after the first div fades out:

$(document).ready(function(){

$("#toggle-product-overview").click(function () {
$("#is-me").fadeOut("500", function() { 
$("#product-overview").fadeIn
("500"); });
});

$("#toggle-is-me").click(function () {
$("#product-overview").fadeOut("500", function() { 
$("#is-me").fadeIn
("500"); });
});
});


Is there anyway i can transition into the next div rather than fade in/
out? Please let me know, i have looked all over the place and tried
many different things, but haven't figured it out yet.

Any help would be greatly appreciated!


[jQuery] Blending / Crossfading two divs together

2009-01-23 Thread bioprez

Hello,

I'm trying to figure out how to blend / crossfade two div's together.
I have found many examples that crossfades two images together, but i
can't find anything on two divs.

Right now i am fading one out, and fading the other back in, but i'd
like them to fade into each other. Here is my current code:

$(document).ready(function(){

$("#toggle-product-overview").click(function () {
$("#is-me").fadeOut("500", function() { 
$("#product-overview").fadeIn
("500"); });
});

$("#toggle-me").click(function () {
$("#product-overview").fadeOut("500", function() { 
$("#is-me").fadeIn
("500"); });
});
});

Uses a callback to fade the next one in once the current fades out.

How can i crossfade the two together?

Any help would be greatly appreciated, i have been looking all over
for something like this but can only find samples for images and not
divs.

Thanks!
Mark


[jQuery] Re: [autocomplete] Problem with .result

2009-01-23 Thread Jörn Zaefferer

You could add another keyup-event-handler to the input field, and
clear the id field. As long as that runs before the result-handler is
setting the data, it should give you the result you need.

Jörn

On Fri, Jan 23, 2009 at 5:09 PM, Styx  wrote:
>
> Hi.
>
> I have two fileds. For exmple:
>
> $("#name").autocomplete('seatch.php');
> $("#id").result(function(event, data, formatted) {
>  if (data) {
>$("#id").val(data[1]);
>  }
>
> If i select sometfing in autocomplete field, my id field will have id
> of this item. After submit I have two fields - one wieth name, and one
> with id. I can for example update dabase use id.
>
> But if I write in autocomplete somethig, which isn't in result, my
> function isn't triggered. If i edit existing data, after submit I have
> field "id" with some value, and filed "name" with new value. I don't
> know, that I shoul add my "name" to database, or do something else.
>
> What I should do to clear field "id" when "name" is write by me and
> dosen't exist in result of 'search.php'?
>
> regards,
> pch
>


[jQuery] Re: [validate] How to validate only one of two forms on a page

2009-01-23 Thread Jörn Zaefferer

A input or button with a class of "cancel" will, when used to submit
the form, skip the validation. I documented that somewhere... The
relevant code is here:
http://dev.jquery.com/browser/trunk/plugins/validate/jquery.validate.js#L40

Jörn

On Fri, Jan 23, 2009 at 5:45 PM, JOR  wrote:
>
> I have two forms on a page.  One is a registration form and the other
> is a log-in form.  How can I disable validation when one button is
> clicked but enable it when another is clicked.  We are using .Net so
> there is only one form tag on the page but visually to the user there
> are two separate forms.
>
> I tried the following but it didn't work:
>
> jQuery('.btnTabLogin').livequery('click', function() {
>jQuery("#Form").validate({
>   onsubmit: false
>});
> });
>
> Then I tried the following:
>
> jQuery('.btnTabLogin').livequery('click', function() {
>jQuery("#Form").validate({
>   errorPlacement: function (error, element) {},
>   rules: new Object(),
>   messages: new Object(),
>   submitHandler: new function() {},
>   onsubmit: false
>});
> });
>
>
> Neither worked.  Can anyone shed some light on this for me?
>
> More ideal would be a solution to have two different validations based
> on the button clicked but I'll be happy to get it working without.
>
> Thanks in advance. JOR
>


[jQuery] Re: Location Persistence... Almost

2009-01-23 Thread Jed

The code looks roughly like this (names changed to protect the
innocent):

Script from the :









document.write(
''
);



 $(document).ready(function(){
$("#navtree").treeview({
animated: "fast",
persist: "location",
collapsed: true,
unique: true
}).css('display','block'); ;
});


>From the :


  http://www.websitename.net";>Home
  http://www.websitename.net/
index.php/level_one_cat_one/1/">Item A
   
Item Aa
http://www.websitename.net/index.php/
level_one_cat_one/117/">Item Ab
http://www.websitename.net/index.php/
level_one_cat_one/118/">Item Ac
  
  
  http://www.websitename.net/
index.php/level_one_cat_two/20/">Item B

 http://www.websitename.net/
index.php/level_one_cat_two/21/">Item Ba
Item Bb
 
  http://www.websitename.net/
index.php/level_one_cat_two/23/">Item Bb1
  http://www.websitename.net/
index.php/level_one_cat_two/24/">Item Bb2
  http://www.websitename.net/
index.php/level_one_cat_two/25/">Item Bb3

  http://www.websitename.net/index.php/level_one_cat_two/99/";>Item
Bb3a
  http://www.websitename.net/
index.php/level_one_cat_two/100/">Item Bb3b
  http://www.websitename.net/
index.php/level_one_cat_two/101/">Item Bb3c
  http://www.websitename.net/
index.php/level_one_cat_two/102/">Item Bb3d
  http://www.websitename.net/
index.php/level_one_cat_two/103/">Item Bb3e


http://www.websitename.net/index.php/
level_one_cat_two/26/">Item Bb4
http://www.websitename.net/index.php/
level_one_cat_two/27/">Item Bb5
http://www.websitename.net/index.php/
level_one_cat_two/28/">Item Bb6

  




End code.

I've tried removing slimbox, gmlightbox, and the script that initially
hides the tree to prevent blinking, but no luck.  When I click on Item
Bb3, for example, the sub tree (Bb3a-e) initially expands, but then
when the page changes to take me (correctly) to Item Bb3, and tree
contracts back to showing no lower than Bb1-6.  I'm using location-
based only, no cookies.  I tried cookies initially, but I couldn't
make it work.

Thanks for any help you can give.

Jed




On Jan 22, 1:26 pm, betweenbrain  wrote:
> Hi Jed,
>
> Are you using cookies (I seem to remember example 3 or 4) ? Also, I
> believe treeview uses  as the parent element. That may clue you
> in the right direction.
>
> It would be helpful if you could post your code or a website with this
> example.
>
> Best,
>
> Matt
>
> On Jan 21, 6:42 pm, Jed  wrote:
>
> > I went back and changed the code to match exactly what's behind Sample
> > 0 on the treeview demo page, but still no joy.
>
> > I can see the tree expand to show the proper subs, but then the page
> > changes, and when the tree reloads that new sub is closed again.


[jQuery] Re: Scale effect and hover

2009-01-23 Thread Mauricio (Maujor) Samy Silva


Here another approach scaling both dimensions.

var imgWidth = $('#scale_img').width();
var imgHeight = $('#scale_img').height();

$('#scale_img').hover(function() {
 $(this).animate({width: 2*imgWidth, height: 2*imgHeight})
  }, function(){
 $(this).animate({width: imgWidth, height: imgHeight})
})

Maurício



-Mensagem Original- 
De: "jay" 

Para: "jQuery (English)" 
Enviada em: sexta-feira, 23 de janeiro de 2009 20:40
Assunto: [jQuery] Re: Scale effect and hover



this works for me.. style is bad though sorry had to do it quick:



something


$(function(){
scaleImg = $("#scale_img");
scaleImg.w = scaleImg.width();

scaleImg.hover(function(){
   scaleImg.width(scaleImg.w*2);
},
function(){
   scaleImg.width(scaleImg.w);
});
});



On Jan 23, 4:44 pm, "-=AmBaRaDaN=-"  wrote:

Hi guys! I'm looking for a simple image hover effect, but with the
scale effect...
I just want make an image bigger on mouse over.
I'm newbie with jQuery, and I tried this

$("#scale_img").hover(function() {
$(this).effect("scale", { percent: 200 });}, function() {

$(this).effect("scale", { percent: 50 });

});

..but hover state doesn't stop after one resize. I mean if I leave my
mouse over, the image continue to resize.
How can i stop that? Any idea to fix it?

i tried also...

$("#test2").hover(function () {
$(this).toggle("scale", { percent: 80 }, 500);
}, function(){
$(this).toggle("scale", { percent: 80 }, 500);
});

..but it's worst.
(it would be wonderful if the scaling has a bounce effect in the
end!!)
Thx a lot anyway for all the tips! 




[jQuery] Re: Slide Toggle Question

2009-01-23 Thread Christian

Sorry for not being clear...  My fault.

If you go to www.usm.edu/music, you'll see the template as it should
be.  Working perfectly, like I want it (with the js.gallery
functioning and rotating the images in the header; but notice the
"quick links" drop-down menu.  Well, I want to take that and move it
into the "slideToggle" above the page, like it is on my test template.

To set that up, I downloaded the jquery library, and placed it on my
server.  I then added the JS code into the template to set up the new
"quick links" in the header portion.  Well, after doing this, my
js.gallery started messing up, not rotating and overlapping, like you
noticed.  I'm not sure how the JS is conflicting all of a sudden, and
I have no idea where to even begin to look at this fix.  I don't have
much JS code in my templates, as I don't use it that much.  The only
time I use it is with the js.gallery and the slideToggle.  So, both
work independently of one another, just not together.

Does that make more sense?

Second question is, after this is fixed, how do I adjust the width of
the toggle field?  Currently, it's larger than my site.  I can't seem
to find a command that declares the size of the field.

Thanks again for looking at this for me



On Jan 23, 4:22 pm, jay  wrote:
> I get javascript errors in IE, and the images overlap the content in
> firefox.. what am I looking for exactly?
>
> On Jan 23, 3:03 pm, Christian  wrote:
>
> > Hey everyone.
>
> > I'm still a bit new to the whole jQuery world.  I love what I've seen
> > so far, and it seems fairly simple to implement on a site.
>
> > I recently viewed a web site through promotion on
> > ExpressionEngine.com, and found the slideToggle effect.  I asked the
> > web admin if they can forward me what they used to create the effect
> > (which was exactly what I was looking for).  I now have it working on
> > my test templates, but I cannot get it to resize.  My site template is
> > at 940px, but the slider is a bit wider, and I cannot find that
> > control anywhere in the code.
>
> > You can check out the page 
> > athttp://www.usm.edu/music/index.php/testing/index/
>
> > Please keep in mind that it's a test template, so some CSS issues will
> > exist.
>
> > Also, I am using a jd.Gallery script, and it is somehow conflicting
> > with the jQuery...  Any help on this would be GREATLY appreciated.
> > I'm not a coder by any means, so please be gentle...  =)


[jQuery] Re: Scale effect and hover

2009-01-23 Thread jay

this works for me.. style is bad though sorry had to do it quick:



something


$(function(){
scaleImg = $("#scale_img");
scaleImg.w = scaleImg.width();

scaleImg.hover(function(){
scaleImg.width(scaleImg.w*2);
},
function(){
scaleImg.width(scaleImg.w);
});
});



On Jan 23, 4:44 pm, "-=AmBaRaDaN=-"  wrote:
> Hi guys! I'm looking for a simple image hover effect, but with the
> scale effect...
> I just want make an image bigger on mouse over.
> I'm newbie with jQuery, and I tried this
>
> $("#scale_img").hover(function() {
>         $(this).effect("scale", { percent: 200 });}, function() {
>
>         $(this).effect("scale", { percent: 50 });
>
> });
>
> ..but hover state doesn't stop after one resize. I mean if I leave my
> mouse over, the image continue to resize.
> How can i stop that? Any idea to fix it?
>
> i tried also...
>
>  $("#test2").hover(function () {
>       $(this).toggle("scale", { percent: 80 }, 500);
>     }, function(){
>                 $(this).toggle("scale", { percent: 80 }, 500);
>         });
>
> ..but it's worst.
> (it would be wonderful if the scaling has a bounce effect in the
> end!!)
> Thx a lot anyway for all the tips!


[jQuery] Re: unrecognized expression after jquery update to 1.3.1

2009-01-23 Thread Mauricio (Maujor) Samy Silva


From: http://docs.jquery.com/Release:jQuery_1.3#Upgrading

"The '@' in [...@attr] has been removed. Deprecated since 1.2 this old syntax 
no longer works"


Maurício


-Mensagem Original- 
De: "youssef" 

Para: "jQuery (English)" 
Enviada em: sexta-feira, 23 de janeiro de 2009 19:26
Assunto: [jQuery] unrecognized expression after jquery update to 1.3.1




After I upgrade to Jquery.1.3.1 , I received this error in my code

uncaught exception: Syntax error, unrecognized expression:
[...@id*=countryidentifier_]
http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js
Line 12

My expression is working fine with 1.2.6.

does any one why? 




[jQuery] Re: Reload Part of a Page

2009-01-23 Thread jay

just reload it with whatever is in the data variable.  $("#myUL").html
(data) will do the trick assuming your data is just html like "12"

On Jan 23, 12:46 pm, Good Knight  wrote:
> Is there an easy way to reload a section of a page?
>
> I have a .post() that updates the contents of an unordered list, but i
> have to refresh the page to see the new contents of the UL. Anyway to
> have the UL reload when the .post() goes off?
>
> I am using the Impromptu plugin to run the post, but this should be
> just a basic jQuery issue I don't think it's a plugin question.
>
> Code can be found athttp://www.pastie.org/368851
>
> Any ideas would be very useful!


[jQuery] Re: jquery.ajax question.

2009-01-23 Thread Trend-King

Thanks for your replies i try it with json format, thanks for that
good tip

On 23 Jan., 11:27, NeX  wrote:
> try tu use JSON data format. It's simly, then parsing html values in
> result.


[jQuery] Re: id question

2009-01-23 Thread jay

based on this wouldn't the syntax be alert($('#id\\{0\\}___').val
()); ?

On Jan 23, 5:19 pm, "Mauricio \(Maujor\) Samy Silva"
 wrote:
> You must escape properly weird characters in ID values.
> Have a look 
> at:http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_...
>
> Maurício
>
> -Mensagem Original-
> De: "gvangass" 
> Para: "jQuery (English)" 
> Enviada em: sexta-feira, 23 de janeiro de 2009 19:56
> Assunto: [jQuery] id question
>
>
>
>
>
> > Hi
>
> > Is there a reason why: alert($('#id\{0}___').val());
> > not displaying the value, also no error with Firebug
>
> > but
>
> > alert(document.getElementById("id{0}___").value);
> > displays it ?
>
> > The html looks like this:
> >  > maxlength="10" size="10" name="id{0}___" />
>
> > show_value()  run the alerts above
>
> > Thanks
> > gvg- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Slide Toggle Question

2009-01-23 Thread jay

I get javascript errors in IE, and the images overlap the content in
firefox.. what am I looking for exactly?

On Jan 23, 3:03 pm, Christian  wrote:
> Hey everyone.
>
> I'm still a bit new to the whole jQuery world.  I love what I've seen
> so far, and it seems fairly simple to implement on a site.
>
> I recently viewed a web site through promotion on
> ExpressionEngine.com, and found the slideToggle effect.  I asked the
> web admin if they can forward me what they used to create the effect
> (which was exactly what I was looking for).  I now have it working on
> my test templates, but I cannot get it to resize.  My site template is
> at 940px, but the slider is a bit wider, and I cannot find that
> control anywhere in the code.
>
> You can check out the page athttp://www.usm.edu/music/index.php/testing/index/
>
> Please keep in mind that it's a test template, so some CSS issues will
> exist.
>
> Also, I am using a jd.Gallery script, and it is somehow conflicting
> with the jQuery...  Any help on this would be GREATLY appreciated.
> I'm not a coder by any means, so please be gentle...  =)


[jQuery] Re: id question

2009-01-23 Thread Mauricio (Maujor) Samy Silva


You must escape properly weird characters in ID values.
Have a look at:
http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

Maurício

-Mensagem Original- 
De: "gvangass" 

Para: "jQuery (English)" 
Enviada em: sexta-feira, 23 de janeiro de 2009 19:56
Assunto: [jQuery] id question




Hi

Is there a reason why: alert($('#id\{0}___').val());
not displaying the value, also no error with Firebug

but

alert(document.getElementById("id{0}___").value);
displays it ?

The html looks like this:


show_value()  run the alerts above

Thanks
gvg 




[jQuery] Re: jquery 1.3, .live(), submit and IE7

2009-01-23 Thread Mike Alsup

> I'm having a strange behavior of the new .live() method when used on a
> submit event. The biggest problem is on IE7, but there is a minor
> problem on other browsers too.
>
> The problem is that if I'm binding a live submit event on a form not
> present in the document, the submit event is not triggered when I
> submit the form (newly created) later on.
>
> You can see an example here 
> :http://www.pixelastic.com/tests/jquery-live-submit-ie7
> By clicking on the 'Add form' link, a new form is added to the page.
> There is also a live('submit') on this form, but it is not triggered
> on IE7.
> I've tried binding a 'normal' submit event just after creating the
> form, and it works, so it really is a problem with the .live() method.
>
> As a sidenote, I had to explicitly select my form with form#myForm
> because only #myForm did not worked on any browsers.
>
> Is that a known limitation I wasn't aware of or am I doing something
> wrong ?


The submit event is not supported by live.

http://docs.jquery.com/Events/live
Currently not supported: blur, focus, mouseenter, mouseleave, change,
submit


[jQuery] Re: id question

2009-01-23 Thread jay

I would assume that it doesn't like the \{0} part.. is this server-
side code or something?

On Jan 23, 4:56 pm, gvangass  wrote:
> Hi
>
> Is there a reason why: alert($('#id\{0}___').val());
> not displaying the value, also no error with Firebug
>
> but
>
> alert(document.getElementById("id{0}___").value);
> displays it ?
>
> The html looks like this:
>  maxlength="10" size="10" name="id{0}___" />
>
> show_value()  run the alerts above
>
> Thanks
> gvg


[jQuery] Re: Highlight onKeyUp using Cursor Keys

2009-01-23 Thread jay

No, not necessarily.  You could store a reference to the selected
element in a variable.  You wouldn't want to have to iterate through
the list of elements every time to determine if it is selected if you
don't have to.

On Jan 23, 4:58 pm, bittermonkey  wrote:
> and to find out which element was selected, I have to check for
> its background?  Is that right?
>
> On Jan 23, 4:49 pm, jay  wrote:
>
>
>
> > You could write something yourself fairly easily.  Just update the
> > backgroundColor css property when you press the up/down keys on your
> > absolutely positioned element, and when you press enter perform an
> > action that is associated with that element.
>
> > On Jan 23, 4:32 pm, bittermonkey  wrote:
>
> > > The code is a bit overwhelming for just the highlight functionality.
> > > Thanks anyway.
>
> > > On Jan 23, 4:17 pm, jay  wrote:
>
> > > > Here is a jquery autocomplete plugin I googled and seems to do what
> > > > you want:
>
> > > >http://www.pengoworks.com/workshop/jquery/autocomplete.htm
>
> > > > On Jan 23, 4:00 pm, bittermonkey  wrote:
>
> > > > > How do I initialize a hover on a  tag using cursor keys in
> > > > > jQuery?  It's similar to how google highlights its autocomplete
> > > > > results. So, from google.com, type the letter "a" in the searchbox
> > > > > then press the Down Arrow Key and notice how the first item in the
> > > > > autocomplete box gets highlighted and so on if you continue pressing
> > > > > it.
>
> > > > > How do I accomplish this in jQuery?- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[jQuery] mysterious $(window).error behavior

2009-01-23 Thread Adam Fisk

I can't seem to get $(window).error to work the way it seems like it
should.  Have a look at the following page:

http://www.littleshoot.org/errorTest2.html

It includes the following, and neither error is caught by the $
(window).error function -- the alert never happens.  Anyone know
what's up?


$(document).ready( function() {
$(window).error(function(msg, url, line) {
alert("Got error");
});
throw new Error("Inside doc ready error");
});
throw new Error("Outside doc ready error");


Thanks.

-Adam Fisk


[jQuery] unrecognized expression after jquery update to 1.3.1

2009-01-23 Thread youssef

 After I upgrade to Jquery.1.3.1 , I received this error in my code

 uncaught exception: Syntax error, unrecognized expression:
 [...@id*=countryidentifier_]
 http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js
 Line 12

My expression is working fine with 1.2.6.

does any one why?


[jQuery] Weird Hiding Issue

2009-01-23 Thread david.vansc...@gmail.com

The answer to this is probably really simple, but I'm just not finding
it.

I'm working on a newsletter and they want the first paragraph of each
article shown, then a More link at the end.  Got that working fine.  I
even have it working so that it automatically hides all but the first
paragraph tag.  Perfect.  However, I have a few unordered lists inside
paragraph tags and the unordered lists aren't hidden when the page
loads, even if they're inside the paragraph tags.  How would I get
those elements to be hidden when the paragraph tag is hidden?  Thanks!


[jQuery] Slide Toggle Question

2009-01-23 Thread Christian

Hey everyone.

I'm still a bit new to the whole jQuery world.  I love what I've seen
so far, and it seems fairly simple to implement on a site.

I recently viewed a web site through promotion on
ExpressionEngine.com, and found the slideToggle effect.  I asked the
web admin if they can forward me what they used to create the effect
(which was exactly what I was looking for).  I now have it working on
my test templates, but I cannot get it to resize.  My site template is
at 940px, but the slider is a bit wider, and I cannot find that
control anywhere in the code.

You can check out the page at http://www.usm.edu/music/index.php/testing/index/

Please keep in mind that it's a test template, so some CSS issues will
exist.

Also, I am using a jd.Gallery script, and it is somehow conflicting
with the jQuery...  Any help on this would be GREATLY appreciated.
I'm not a coder by any means, so please be gentle...  =)


[jQuery] Scale effect and hover

2009-01-23 Thread -=AmBaRaDaN=-

Hi guys! I'm looking for a simple image hover effect, but with the
scale effect...
I just want make an image bigger on mouse over.
I'm newbie with jQuery, and I tried this

$("#scale_img").hover(function() {
$(this).effect("scale", { percent: 200 });
}, function() {
$(this).effect("scale", { percent: 50 });
});

..but hover state doesn't stop after one resize. I mean if I leave my
mouse over, the image continue to resize.
How can i stop that? Any idea to fix it?

i tried also...

 $("#test2").hover(function () {
  $(this).toggle("scale", { percent: 80 }, 500);
}, function(){
$(this).toggle("scale", { percent: 80 }, 500);
});

..but it's worst.
(it would be wonderful if the scaling has a bounce effect in the
end!!)
Thx a lot anyway for all the tips!


[jQuery] Reload Part of a Page

2009-01-23 Thread Good Knight

Is there an easy way to reload a section of a page?

I have a .post() that updates the contents of an unordered list, but i
have to refresh the page to see the new contents of the UL. Anyway to
have the UL reload when the .post() goes off?

I am using the Impromptu plugin to run the post, but this should be
just a basic jQuery issue I don't think it's a plugin question.

Code can be found at http://www.pastie.org/368851

Any ideas would be very useful!


[jQuery] Re: TableSorter, Turning Sort Off

2009-01-23 Thread webchetan

How can I mainitain TableSort on subsequent postbacks. Basically I
sort a table using tablesorter() and when I click on Page# 2 in
GridView (ASP.NET) the sorting doesn't persists. Is there anyway I can
store the sorting values actross pages?

Thanks



On Jan 23, 11:21 am, jay  wrote:
> I amend what I said.  A hashtable is not necessary for going from row
> number to unique id, an array is fine.  Going from unique id to row
> number, however, is necessary.
>
> On Jan 23, 11:16 am, jay  wrote:
>
>
>
> > If you just postback the page, the table should be restored to the
> > original state.  Otherwise, if you have a unique id for each row you
> > could try creating a hash table which returns the unique id based on
> > the row number (create the hash table when page is first loaded).
> > Then you could just loop through the row numbers and insert each TR
> > based on the unique id that is returned using the DOM.  As for turning
> > it off, you could simply save the old TH event handlers and replace
> > them with function(){return false;} temporarily.
>
> > On Jan 23, 10:56 am, NRutman  wrote:
>
> > > Hello,
>
> > > I'm considering using the TableSorter plugin (http://tablesorter.com)
> > > for one of my projects, but I need to reconcile one thing: does anyone
> > > know how I can revert the sort back to the original?  Or even, how to
> > > turn the sort-state to OFF, so that no header is selected and it
> > > doesn't try to sort?  That way I could at least reload the table from
> > > the original data array.
>
> > > Any suggestions?
>
> > > Thanks,
> > > -Nate- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[jQuery] jquery 1.3, .live(), submit and IE7

2009-01-23 Thread Pixelastic

Hello,

I'm having a strange behavior of the new .live() method when used on a
submit event. The biggest problem is on IE7, but there is a minor
problem on other browsers too.

The problem is that if I'm binding a live submit event on a form not
present in the document, the submit event is not triggered when I
submit the form (newly created) later on.

You can see an example here : 
http://www.pixelastic.com/tests/jquery-live-submit-ie7
By clicking on the 'Add form' link, a new form is added to the page.
There is also a live('submit') on this form, but it is not triggered
on IE7.
I've tried binding a 'normal' submit event just after creating the
form, and it works, so it really is a problem with the .live() method.

As a sidenote, I had to explicitly select my form with form#myForm
because only #myForm did not worked on any browsers.

Is that a known limitation I wasn't aware of or am I doing something
wrong ?


[jQuery] id question

2009-01-23 Thread gvangass

Hi

Is there a reason why: alert($('#id\{0}___').val());
not displaying the value, also no error with Firebug

but

alert(document.getElementById("id{0}___").value);
displays it ?

The html looks like this:


show_value()  run the alerts above

Thanks
gvg


[jQuery] Superfish Opacity

2009-01-23 Thread levine....@gmail.com

Greetings all,

I also am having an issue with turning off the opacity in Superfish. I
think I need to pass something like "opacity: false" but this does not
work. I have also tried "hide" as well.

Help please.
Thanks,
Ron


[jQuery] Re: Highlight onKeyUp using Cursor Keys

2009-01-23 Thread bittermonkey

and to find out which element was selected, I have to check for
its background?  Is that right?

On Jan 23, 4:49 pm, jay  wrote:
> You could write something yourself fairly easily.  Just update the
> backgroundColor css property when you press the up/down keys on your
> absolutely positioned element, and when you press enter perform an
> action that is associated with that element.
>
> On Jan 23, 4:32 pm, bittermonkey  wrote:
>
> > The code is a bit overwhelming for just the highlight functionality.
> > Thanks anyway.
>
> > On Jan 23, 4:17 pm, jay  wrote:
>
> > > Here is a jquery autocomplete plugin I googled and seems to do what
> > > you want:
>
> > >http://www.pengoworks.com/workshop/jquery/autocomplete.htm
>
> > > On Jan 23, 4:00 pm, bittermonkey  wrote:
>
> > > > How do I initialize a hover on a  tag using cursor keys in
> > > > jQuery?  It's similar to how google highlights its autocomplete
> > > > results. So, from google.com, type the letter "a" in the searchbox
> > > > then press the Down Arrow Key and notice how the first item in the
> > > > autocomplete box gets highlighted and so on if you continue pressing
> > > > it.
>
> > > > How do I accomplish this in jQuery?- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Re: Highlight onKeyUp using Cursor Keys

2009-01-23 Thread jay

You could write something yourself fairly easily.  Just update the
backgroundColor css property when you press the up/down keys on your
absolutely positioned element, and when you press enter perform an
action that is associated with that element.

On Jan 23, 4:32 pm, bittermonkey  wrote:
> The code is a bit overwhelming for just the highlight functionality.
> Thanks anyway.
>
> On Jan 23, 4:17 pm, jay  wrote:
>
>
>
> > Here is a jquery autocomplete plugin I googled and seems to do what
> > you want:
>
> >http://www.pengoworks.com/workshop/jquery/autocomplete.htm
>
> > On Jan 23, 4:00 pm, bittermonkey  wrote:
>
> > > How do I initialize a hover on a  tag using cursor keys in
> > > jQuery?  It's similar to how google highlights its autocomplete
> > > results. So, from google.com, type the letter "a" in the searchbox
> > > then press the Down Arrow Key and notice how the first item in the
> > > autocomplete box gets highlighted and so on if you continue pressing
> > > it.
>
> > > How do I accomplish this in jQuery?- Hide quoted text -
>
> - Show quoted text -


[jQuery] Encoding characters using load("some_file.html")

2009-01-23 Thread Mauricio (Maujor) Samy Silva
Subject: The best way to encode special caracters when requesting a  **HTML 
fragments**  using the jQuery method load().
There are tons of discussions on this subject but I didn't realize the right 
(best) way to go. Or how many ways ("bullet proof") are there?

Please have a look at a test case:

http://www.livrojquery.com.br/ajax-jquery/teste1-load-html/load-html-en.html

TIA

Maurício


[jQuery] Re: Cycle plugin an absolute positioning

2009-01-23 Thread illuminati78


Ok - I got the centering thing working on FF Opera and IE7 - not tested in
IE6 yet - but now i have another problem - the slideshow dont work when
using with Lightbox2 - i made a test page - anyone have an idea on how to
fix this?  http://test.ywn.no/jQuery/ test 

-- 
View this message in context: 
http://www.nabble.com/Cycle-plugin-an-absolute-positioning-tp16039437s27240p21633115.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Highlight onKeyUp using Cursor Keys

2009-01-23 Thread bittermonkey

The code is a bit overwhelming for just the highlight functionality.
Thanks anyway.

On Jan 23, 4:17 pm, jay  wrote:
> Here is a jquery autocomplete plugin I googled and seems to do what
> you want:
>
> http://www.pengoworks.com/workshop/jquery/autocomplete.htm
>
> On Jan 23, 4:00 pm, bittermonkey  wrote:
>
> > How do I initialize a hover on a  tag using cursor keys in
> > jQuery?  It's similar to how google highlights its autocomplete
> > results. So, from google.com, type the letter "a" in the searchbox
> > then press the Down Arrow Key and notice how the first item in the
> > autocomplete box gets highlighted and so on if you continue pressing
> > it.
>
> > How do I accomplish this in jQuery?


[jQuery] Re: Highlight onKeyUp using Cursor Keys

2009-01-23 Thread jay

Here is a jquery autocomplete plugin I googled and seems to do what
you want:

http://www.pengoworks.com/workshop/jquery/autocomplete.htm

On Jan 23, 4:00 pm, bittermonkey  wrote:
> How do I initialize a hover on a  tag using cursor keys in
> jQuery?  It's similar to how google highlights its autocomplete
> results. So, from google.com, type the letter "a" in the searchbox
> then press the Down Arrow Key and notice how the first item in the
> autocomplete box gets highlighted and so on if you continue pressing
> it.
>
> How do I accomplish this in jQuery?


[jQuery] Re: getting to a variable in the parent frame - stumped

2009-01-23 Thread jay

That makes sense. I think you just need document if you need to access
the other frame's DOM tree.

On Jan 23, 4:04 pm, jquertil  wrote:
> oh! I got it. thanks Jay, your suggestion gave me the hint I needed to
> figure it out.
>
> removing var did 1/2 the trick, the second 1/2 was me realizing that
> now I have module as object of the top document, so
>
> top.module.something1('hello');
>
> works.
>
> yay! this drove me crazy last night!


[jQuery] Re: $.ajax() wierdness

2009-01-23 Thread Kraulin


Update:

  This turned out to be an infrastructure problem... jQuery will error out
if you ask for an XML file with datatype:'xml' and the response header is
not text/xml.

-=Bryan



Kraulin wrote:
> 
> I'm experiencing a problem with consuming an xml file that exists on my
> server...
> 
> I'm doing my development on an Apache 2.2 instance and when I read in the
> xml file it calls the 'success' parameter correctly and the execution goes
> on and the xml is parsed.
> 
> However when I deployed this same code to our 'Sun-ONE-Web-Server/6.1', 
> 'success' is never called... only 'error'.  Now I might understand what
> was going on if it were not for the following points.
> 
> 1. With dataType:"xml" Firebug reports that the 'GET' occurred, that it
> has a response code of 200 and when I open up the 'GET', I can click on
> the 'response' tab and see the contents of my xml file, however it invoked
> the 'error' method in my call.
> 
> 2. if I change the 'dataType' parameter to 'text', 'html', or 'script',
> they all invoke the 'success' parameter. But none of them actually work to
> allow for the parsing of xml.
> 
> I can use the .ajax() command to download every thing except XML files.
> 
> I should also mention that this happens with 1.2.6, 1.3 and 1.3.1
> 
> Thoughts?
> 
> -=Bryan
> 

-- 
View this message in context: 
http://www.nabble.com/%24.ajax%28%29-wierdness-tp21626489s27240p21632698.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: getting to a variable in the parent frame - stumped

2009-01-23 Thread jquertil

oh! I got it. thanks Jay, your suggestion gave me the hint I needed to
figure it out.

removing var did 1/2 the trick, the second 1/2 was me realizing that
now I have module as object of the top document, so

top.module.something1('hello');

works.

yay! this drove me crazy last night!


[jQuery] Re: superfish help

2009-01-23 Thread Skye

Thanks Joel. Dumb error with the JQuery. I'm using the Superfish css
file included with the package for the dropdowns. I just modded the
class name and changed it to an id instead b/c that's how extended
menu publishes the menu with id instead of class. not sure if that
will effect the sample css or not.

On Jan 23, 12:27 am, Joel Birch  wrote:
> Hello,
>
> You need to include the jQuery JS file before theSuperfishJS file.
> That should fix the JS errors you are getting. Also, make sure your
> menu works without JS first (your CSS should allow for that in all
> modern browsers, (not IE6)), as yours currently does not.
>
> Joel Birch.


[jQuery] Highlight onKeyUp using Cursor Keys

2009-01-23 Thread bittermonkey

How do I initialize a hover on a  tag using cursor keys in
jQuery?  It's similar to how google highlights its autocomplete
results. So, from google.com, type the letter "a" in the searchbox
then press the Down Arrow Key and notice how the first item in the
autocomplete box gets highlighted and so on if you continue pressing
it.

How do I accomplish this in jQuery?


[jQuery] Re: getting to a variable in the parent frame - stumped

2009-01-23 Thread jquertil

thanks - that was an interesting consideration. Unfortunately didn't
make a difference.

(still scratching head)


[jQuery] Re: Bug? ajax request headers not being modified by beforeSend (jquery 1.3.1)

2009-01-23 Thread Nicolas R

It seems that when I use GET instead of POST, the content type header
is correctly changed to what I specify.

But even so, this is not a stable fix as I want to POST.

Any ideas?


On Jan 22, 7:09 pm, Nicolas R  wrote:
> I need some help here guys.
> I'm trying to modify the content-type and accept-charsetrequest
> headers of an ajax call and it seems that beforeSend does not really
> change the XHR object.
>
> My code is something like this:
>                 beforeSend : function(xhr) {
>                         xhr.setRequestHeader('Accept-Charset','windows-1253');
>                         
> xhr.setRequestHeader('Content-type','application/x-www-form-
> urlencoded;charset=windows-1253')
>                 }
>
> I need the charset to be windows-1253 and not UTF-8, as the database
> and everything in between (server side scripts) are encoded with
> windows-1253.
>
> My html page has the correct charset specified:
>         
>         
>
> If I submit the form without ajax, the charset is ok and my data is
> saved correctly. Otherwise non-latin characters are replaced with
> weird characters. From what I understand, changing the charset &
> encoding to UTF-8 is currently not an option.
>
> Any suggestions? Is this a jquery bug or I'm I doing something wrong?


[jQuery] Re: getting to a variable in the parent frame - stumped

2009-01-23 Thread jay

perhaps you need to do this.module = {...}? Doing var module makes it
"private" I believe

On Jan 23, 3:31 pm, jquertil  wrote:
> I'm using frames (don't ask) and have exhausted my abilities
> (sniff)... here is some pseudo-code to illustrate the situation:
>
>  first, CONTAINER.HTM:
> 
> $(function(){
>
> var module = {
>    something1 : function(var1){
>       alert(var2);
>    }
>
> }
> });
>
> 
>
> - now, IFRAME1.HTM
> 
> $(function(){
>    $('#myDiv').click(function(){
>       top.frames[0].document.module.something1('hello');
>       // this line above is the part where I'm stuck.
>       //why won't this darn thing cooperate and alert my variable?
>    });
>
> });
>
> click me


[jQuery] Re: Html navigation menus

2009-01-23 Thread Spencer

Thanks Joel. I'll have to give Superfish another try.



[jQuery] getting to a variable in the parent frame - stumped

2009-01-23 Thread jquertil

I'm using frames (don't ask) and have exhausted my abilities
(sniff)... here is some pseudo-code to illustrate the situation:

 first, CONTAINER.HTM:

$(function(){

var module = {
   something1 : function(var1){
  alert(var2);
   }
}

});



- now, IFRAME1.HTM

$(function(){
   $('#myDiv').click(function(){
  top.frames[0].document.module.something1('hello');
  // this line above is the part where I'm stuck.
  //why won't this darn thing cooperate and alert my variable?
   });
});

click me


[jQuery] Re: neccessity of binding update after adding html dynamically

2009-01-23 Thread jay

If they are already binded they should be fine.. You can move the
elements around the DOM tree and they will have the same events as
before..  When you're doing html() you're creating new elements, and
therefore they don't have any events related to them..unless you have
an onclick attribute.. but then that wouldn't be the jQuery way..


On Jan 23, 1:29 pm, aldana  wrote:
> yes this was it.
>
> when not using html() and setting values with "normal" dom-operations
> instead I wouldn't need to rebind, correct?
>
>
>
>
>
> jay-125 wrote:
>
> > If you do:
>
> > $(anyElement).html("blah");
>
> > then you will need to do:
> > $('#bla').bind("click",function(){.});
>
> > after the html() call.
>
> > Does this answer your question?
>
> > On Jan 23, 11:30 am, aldana  wrote:
> >> I am binding elements inside document.ready():
> >> $('#bla').bind("click",function(){.});
>
> >> At some point html is added dynamically:
> >> anyElement.html=" "
>
> >> would then a callback added to the dom representation of the dynamically
> >> added snippet also or would i need again to call $('#bla').bind(...)?
>
> >> thanks.
>
> >> -
> >> manuel aldana
> >> aldana((at))gmx.de
> >> software-engineering blog:http://www.aldana-online.de
> >> --
> >> View this message in
> >> context:http://www.nabble.com/neccessity-of-binding-update-after-adding-html-...
> >> Sent from the jQuery General Discussion mailing list archive at
> >> Nabble.com.
>
> -
> manuel aldana
> aldana((at))gmx.de
> software-engineering blog:http://www.aldana-online.de
> --
> View this message in 
> context:http://www.nabble.com/neccessity-of-binding-update-after-adding-html-...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.- 
> Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Download a file from server...

2009-01-23 Thread Nicolas R

I also worked around this by using an iframe, and pointing the form's
(or anchor's) target attribute to that iframe. Some browsers don't
like it when the iframe is set to visibility:hidden or display:none.
If you make it position:absolute;height:0;width:0;border:0; it should
be ok.

Now, I want to know when the 'save file' pop up is displayed to the
user (=> when the server has done processing the user's request).
Apparently, the iframe's load event is not triggered when the server
does not give back any text/html.

Any workaround for this?


[jQuery] Re: Query on jQuery object?

2009-01-23 Thread corb

Ahh... lightbulb just came on. Thanks a lot.

On Jan 23, 12:09 pm, jay  wrote:
> That makes more sense.. children() will only do immediate
> descendents.  You could also do mydiv.find(expr) as well I suppose.
>
> On Jan 23, 1:04 pm, Eric Garside  wrote:
>
> > var mydiv = $('#mydiv');
> > $('.childdiv', mydiv).css('font-weght', 'bold');
>
> > On Jan 23, 12:57 pm, corb  wrote:
>
> > > This may obvious, but I haven't seen any examples that fit what I'm
> > > trying to do. In many places in my code, I will select an element once
> > > into a var and make necessary changes. What I can't seem to figure out
> > > or find documentation on is querying on an existing object.
>
> > > Here's what I have to do now:
>
> > > $().ready(function(){
> > >     $("#mydiv").click(function(){alert('hello')});
> > >     $("#mydiv .childdiv").css("font-weight", "bold");}
>
> > > seems a tad inefficient to make two trips through the DOM.
>
> > > Here's what I would like to do:
> > > $().ready(function(){
> > >     var mydiv = $("#mydiv");
> > >     mydiv.click(function(){alert('hello')});
> > >    // here's where I'm lost
> > >    // find all the element identified as "childdiv" and set its css
> > >   mydiv("#childdiv").css("font-weight", "bold");
> > >  // is there a way to do this with out multiple trips to the DOM?
>
> > > }- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Re: Query on jQuery object?

2009-01-23 Thread Eric Garside

Yea, me and the .children() method have grown apart. I much prefer the
$('.child', parent) syntax. It looks cleaner, and is shorter, which is
always nice.

On Jan 23, 1:09 pm, jay  wrote:
> That makes more sense.. children() will only do immediate
> descendents.  You could also do mydiv.find(expr) as well I suppose.
>
> On Jan 23, 1:04 pm, Eric Garside  wrote:
>
> > var mydiv = $('#mydiv');
> > $('.childdiv', mydiv).css('font-weght', 'bold');
>
> > On Jan 23, 12:57 pm, corb  wrote:
>
> > > This may obvious, but I haven't seen any examples that fit what I'm
> > > trying to do. In many places in my code, I will select an element once
> > > into a var and make necessary changes. What I can't seem to figure out
> > > or find documentation on is querying on an existing object.
>
> > > Here's what I have to do now:
>
> > > $().ready(function(){
> > >     $("#mydiv").click(function(){alert('hello')});
> > >     $("#mydiv .childdiv").css("font-weight", "bold");}
>
> > > seems a tad inefficient to make two trips through the DOM.
>
> > > Here's what I would like to do:
> > > $().ready(function(){
> > >     var mydiv = $("#mydiv");
> > >     mydiv.click(function(){alert('hello')});
> > >    // here's where I'm lost
> > >    // find all the element identified as "childdiv" and set its css
> > >   mydiv("#childdiv").css("font-weight", "bold");
> > >  // is there a way to do this with out multiple trips to the DOM?
>
> > > }- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Re: If object wrapped, parents can't be found?

2009-01-23 Thread jay

This worked for me:




$(function(){
$("#myEl").wrap("").parents().each(function(){alert
(this.tagName)})
});




something




On Jan 23, 1:24 pm, Nic Hubbard  wrote:
> I ran into a strange problem which too me a while to figure out what
> was going on.  I used the .wrap() function to wrap an element with a
> span.  Then, later on in my script I wanted to find all of the parents
> (using .parents() or even p.arent()) of the element that I wrapped.
> Strangely, it would always only find the parent that was wrapped
> around it, and nothing higher than that, is this normal?


[jQuery] Re: neccessity of binding update after adding html dynamically

2009-01-23 Thread aldana


yes this was it.

when not using html() and setting values with "normal" dom-operations
instead I wouldn't need to rebind, correct?


jay-125 wrote:
> 
> 
> If you do:
> 
> $(anyElement).html("blah");
> 
> then you will need to do:
> $('#bla').bind("click",function(){.});
> 
> after the html() call.
> 
> Does this answer your question?
> 
> On Jan 23, 11:30 am, aldana  wrote:
>> I am binding elements inside document.ready():
>> $('#bla').bind("click",function(){.});
>>
>> At some point html is added dynamically:
>> anyElement.html=" "
>>
>> would then a callback added to the dom representation of the dynamically
>> added snippet also or would i need again to call $('#bla').bind(...)?
>>
>> thanks.
>>
>> -
>> manuel aldana
>> aldana((at))gmx.de
>> software-engineering blog:http://www.aldana-online.de
>> --
>> View this message in
>> context:http://www.nabble.com/neccessity-of-binding-update-after-adding-html-...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 


-
manuel aldana
aldana((at))gmx.de
software-engineering blog: http://www.aldana-online.de
-- 
View this message in context: 
http://www.nabble.com/neccessity-of-binding-update-after-adding-html-dynamically-tp21627822s27240p21630219.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] If object wrapped, parents can't be found?

2009-01-23 Thread Nic Hubbard

I ran into a strange problem which too me a while to figure out what
was going on.  I used the .wrap() function to wrap an element with a
span.  Then, later on in my script I wanted to find all of the parents
(using .parents() or even p.arent()) of the element that I wrapped.
Strangely, it would always only find the parent that was wrapped
around it, and nothing higher than that, is this normal?


[jQuery] Re: jquery not working at all after upgrade to 1.3.1

2009-01-23 Thread Jay

This was never a problem before, was something changed in 1.3 that
would make this necessary?

Reason for both ways is large application built OOP in php.

Just made it so page has no body onloads and problem persists.  I did
change the flexDestroy function to be off the jquery function, that
was a nice find.

On Jan 23, 12:54 pm, seasoup  wrote:
> Well, one issue might be that you are using onload in the body tag why
> not use the jQuery ready function that you are already using above?
>
> $(document).ready(function(){
>   $('#gid3').flexigrid();
>   DynarchMenu.setup('hmenu_01',{
>     context: true,
>     electric: 500,
>     tooltips: true
>   });
>   FormUtil.focusOnFirst('ttr01_con0');
>   DynarchMenu.setup('hmenu_02',{
>     electric: true
>   });
>   FormUtil.focusOnFirst(document)
>
> });
>
> Same with the unload in the body tag.
>
> $(document).unload(function(){
>   $('#gid3').flexDestroy();}
>
> On Jan 23, 9:04 am, Jay  wrote:
>
> > Unfortunately, no, classified type site.  Here is code though with
> > details removed that may be problematic. There are 2 function using
> > jquery, flexigrid, and a function I wrote called flexDestroy.
>
> > This is the same error I get when I was building the app and the id,
> > gid3 in this case, did not exist on the page.  It does exist, but is
> > hidden. I tried unhiding it and it didnt change anything. I can toggle
> > between 1.2.6 and 1.3.1 and watch as it works, then doesn't work.
>
> >  > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> >  > language="JavaScript">
> > function columnMove(order,scope){
> >             var params = "";
> >             if(scope != null)
> >             {
> >               params += "&page_scope=" + scope;
> >             }
> >             $.ajax({
> >             type: "GET",
> >             url: "",
> >             data: params
> >             });
> >           };;
> > 
> > $
> > (document).ready(function(){$('#gid3').flexigrid();});
>
> > 
> > 
>
> > 
>
> > On Jan 23, 11:35 am, Mike Alsup  wrote:
>
> > > > I have various jquery apps.  In 1.3.1 I get the error "$
> > > > ('#id3').functionName is not a function.
>
> > > > I switch to 1.2.6 and everything works fine.  Anyone else running into
> > > > this?
>
> > > Can you please post a link that demonstrates the problem you're having?


[jQuery] Re: Query on jQuery object?

2009-01-23 Thread jay

That makes more sense.. children() will only do immediate
descendents.  You could also do mydiv.find(expr) as well I suppose.

On Jan 23, 1:04 pm, Eric Garside  wrote:
> var mydiv = $('#mydiv');
> $('.childdiv', mydiv).css('font-weght', 'bold');
>
> On Jan 23, 12:57 pm, corb  wrote:
>
>
>
> > This may obvious, but I haven't seen any examples that fit what I'm
> > trying to do. In many places in my code, I will select an element once
> > into a var and make necessary changes. What I can't seem to figure out
> > or find documentation on is querying on an existing object.
>
> > Here's what I have to do now:
>
> > $().ready(function(){
> >     $("#mydiv").click(function(){alert('hello')});
> >     $("#mydiv .childdiv").css("font-weight", "bold");}
>
> > seems a tad inefficient to make two trips through the DOM.
>
> > Here's what I would like to do:
> > $().ready(function(){
> >     var mydiv = $("#mydiv");
> >     mydiv.click(function(){alert('hello')});
> >    // here's where I'm lost
> >    // find all the element identified as "childdiv" and set its css
> >   mydiv("#childdiv").css("font-weight", "bold");
> >  // is there a way to do this with out multiple trips to the DOM?
>
> > }- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Query on jQuery object?

2009-01-23 Thread Karl Swedberg
There are two ways you could do this -- by storing the selector in a  
variable or by chaining.


Variable:

// version a, using .find():
$(document).ready(function(){
  var $mydiv = $("#mydiv");
  $mydiv.click(function(){alert('hello')});
  $mydiv.find(".childdiv").css("font-weight", "bold");
});

// version b, using contextual selector:
$(document).ready(function(){
  var $mydiv = $("#mydiv");
  $mydiv.click(function(){alert('hello')});
  $(".childdiv", $mydiv).css("font-weight", "bold");
});

Chaining

$(document).ready(function(){
  $("#mydiv").click(function(){alert('hello')})
.find(".childdiv").css("font-weight", "bold");
});


--Karl


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




On Jan 23, 2009, at 12:57 PM, corb wrote:



This may obvious, but I haven't seen any examples that fit what I'm
trying to do. In many places in my code, I will select an element once
into a var and make necessary changes. What I can't seem to figure out
or find documentation on is querying on an existing object.

Here's what I have to do now:

$().ready(function(){
   $("#mydiv").click(function(){alert('hello')});
   $("#mydiv .childdiv").css("font-weight", "bold");
}
seems a tad inefficient to make two trips through the DOM.


Here's what I would like to do:
$().ready(function(){
   var mydiv = $("#mydiv");
   mydiv.click(function(){alert('hello')});
  // here's where I'm lost
  // find all the element identified as "childdiv" and set its css
 mydiv("#childdiv").css("font-weight", "bold");
// is there a way to do this with out multiple trips to the DOM?
}




[jQuery] Re: Problem with Magnify jQuery plugin in IE7

2009-01-23 Thread PIT_777

Padding on the stageCss i using because, without this some photos in
big version was without some part near to border line(without padding
plugin cuting some border part of photo)

Regards,
Peter

On 23 Sty, 09:38, "proact...@gmail.com"  wrote:
> Hi, here Peter (I writing from other account),
> i already done all this things what you write, now i'm using one class
> to all magnify links, also i moved this stagePlacement to good place,
> and still not working.
>
> Next i try replace png with jpg format, also not working.
> And last i removed all the options from plugin settings in head, this
> also didn't take effect.
>
> In other browsers working(I checked Opera and FireFox), but in IE7
> didn't work.
>
> Have you some other idea why this not working?
>
> Regards,
> Peter
>
> Josh Nathanson napisał(a):
>
>
>
> > Oh, I see another problem.  You have "stagePlacement" values in your
> > stageCss option.  StageCss can only have valid CSS attributes, so this will
> > probably break IE.
>
> > StagePlacement is a separate option, so your options should look like this:
>
> > $("#d02").magnify({
> >            lensWidth: 27,
> >            lensHeight: 27,
> >            showEvent: 'click',
> >            hideEvent: 'mouseout',
> >            stageCss: { border: '3px solid #CC', padding: '15px'},
> >            stagePlacement: 'left'
> >    });
> > Also - I wouldn't recommend using padding on the stageCss, this could lead
> > to some funky results.
>
> > -- Josh
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> > Behalf Of PIT
> > Sent: Thursday, January 22, 2009 10:38 AM
> > To: jQuery (English)
> > Subject: [jQuery] Problem with Magnify jQuery plugin in IE7
>
> > Hello,
> > I have problem to show the big version of the image in IE7, in other
> > browsers working good.
> > My website where i use Your plugin is:
> >http://www.dobrestudium.pl/kurs_paznokci.html.php
> > In attachement i sending screen of place at site wher i use Magnify.
> > I apply Magnify at one page to 14 images.
>
> > I done all good with documentacion and i don't know why not working,
> > your website example working in IE7, but my not :(
>
> > Please give me some information why it's not working.
>
> > Regards,
> > Peter


[jQuery] Re: Can't append html to textare after jquery.form ajax submit

2009-01-23 Thread drewtown

Thanks for the response I do appreciate it.  I tried your code and was
not having any look so I looked at the jquery form plugin docs and
found this little gem

$('#journalForm').ajaxForm({
dataType:  'json',
success:   process,
resetForm: true
});

resetForm: true.  worked quite well.

Thanks and sorry for wasting your time.

Drew

On Jan 22, 7:51 pm, Ami  wrote:
> This is the code:
> function bindButtons () {
> $('#bold,#italic,#underline').unbind().click(function() {
>                         $('#body').append($(this).val());
>
> }
>
>    $(document).ready(function() {
>
>                 $('#journalForm').ajaxForm({
>                         dataType:  'json',
>                         success:  function ()  {process();bindButtons
> ()}
>                 });
>
>                 function process(json) {
>                         blah blah blah irrelevant
>                 }
> bindButtons()
>                 });
>         });
>
> On Jan 23, 3:49 am, Ami  wrote:
>
> > You can try this.
>
> > 1. Create this function:
>
> > function bindButtons () {
> > $('#bold,#italic,#underline').unbind().click(function() {
> >                         $('#body').append($(this).val());
>
> > }
>
> > 2. change the ready function:
> >        $(document).ready(function() {
>
> >                 $('#journalForm').ajaxForm({
> >                         dataType:  'json',
> >                         success:   process
> >                 });
>
> >                 function process(json) {
> >                         blah blah blah irrelevant
> >                 }
>
> >                bindButtons();
>
> >                 });
> >         });
>
> > 3. Add this code to your submit event, for example:
> > $.ajaxSubmit ( {   success:bindButtons()       })
>
> > On Jan 23, 12:00 am, drewtown  wrote:
>
> > > I am writing a user input form and I have buttons set up that add [b]
> > > [i][u] etc tags to the form like BBCode.  The user can then submit it
> > > (uses the jquery.form plugin) and everything works fine.  If the user
> > > then tries to type more and use the buttons again the buttons don't
> > > append to the textare anymore.
>
> > > Any ideas
>
> > > [code below]
>
> > >         $(document).ready(function() {
>
> > >                 $('#journalForm').ajaxForm({
> > >                         dataType:  'json',
> > >                         success:   process
> > >                 });
>
> > >                 function process(json) {
> > >                         blah blah blah irrelevant
> > >                 }
>
> > >                 $('#bold,#italic,#underline').click(function() {
> > >                         $('#body').append($(this).val());
> > >                 });
> > >         });


[jQuery] Re: Query on jQuery object?

2009-01-23 Thread Eric Garside

var mydiv = $('#mydiv');
$('.childdiv', mydiv).css('font-weght', 'bold');

On Jan 23, 12:57 pm, corb  wrote:
> This may obvious, but I haven't seen any examples that fit what I'm
> trying to do. In many places in my code, I will select an element once
> into a var and make necessary changes. What I can't seem to figure out
> or find documentation on is querying on an existing object.
>
> Here's what I have to do now:
>
> $().ready(function(){
>     $("#mydiv").click(function(){alert('hello')});
>     $("#mydiv .childdiv").css("font-weight", "bold");}
>
> seems a tad inefficient to make two trips through the DOM.
>
> Here's what I would like to do:
> $().ready(function(){
>     var mydiv = $("#mydiv");
>     mydiv.click(function(){alert('hello')});
>    // here's where I'm lost
>    // find all the element identified as "childdiv" and set its css
>   mydiv("#childdiv").css("font-weight", "bold");
>  // is there a way to do this with out multiple trips to the DOM?
>
> }


[jQuery] Re: Query on jQuery object?

2009-01-23 Thread jay

Would mydiv.children("#childdiv").css("font-weight", "bold"); work?

On Jan 23, 12:57 pm, corb  wrote:
> This may obvious, but I haven't seen any examples that fit what I'm
> trying to do. In many places in my code, I will select an element once
> into a var and make necessary changes. What I can't seem to figure out
> or find documentation on is querying on an existing object.
>
> Here's what I have to do now:
>
> $().ready(function(){
>     $("#mydiv").click(function(){alert('hello')});
>     $("#mydiv .childdiv").css("font-weight", "bold");}
>
> seems a tad inefficient to make two trips through the DOM.
>
> Here's what I would like to do:
> $().ready(function(){
>     var mydiv = $("#mydiv");
>     mydiv.click(function(){alert('hello')});
>    // here's where I'm lost
>    // find all the element identified as "childdiv" and set its css
>   mydiv("#childdiv").css("font-weight", "bold");
>  // is there a way to do this with out multiple trips to the DOM?
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: 1.3.1 is over 10x slower than 1.2.6

2009-01-23 Thread Loren

Yes, I expect the new event triggering logic to be the cause of the
slowdown.  In two other areas I had manually called trigger() during a
mouseover event.  Whenever my mouse passed over that element, my
machine froze - cpu pegged at 100% for several seconds.  This was also
while I was running that old FF profile.

After reading the upgrade docs, I added a stopPropagation() in my
event handler, and that solved the problem.  My guess is that this is
a similar issue with my initialization.

Over the weekend I will assemble a test case simulating the things our
app does on startup.  I'll try to determine the root cause and post to
the list, along with the test case.

-Loren


[jQuery] Query on jQuery object?

2009-01-23 Thread corb

This may obvious, but I haven't seen any examples that fit what I'm
trying to do. In many places in my code, I will select an element once
into a var and make necessary changes. What I can't seem to figure out
or find documentation on is querying on an existing object.

Here's what I have to do now:

$().ready(function(){
$("#mydiv").click(function(){alert('hello')});
$("#mydiv .childdiv").css("font-weight", "bold");
}
seems a tad inefficient to make two trips through the DOM.


Here's what I would like to do:
$().ready(function(){
var mydiv = $("#mydiv");
mydiv.click(function(){alert('hello')});
   // here's where I'm lost
   // find all the element identified as "childdiv" and set its css
  mydiv("#childdiv").css("font-weight", "bold");
 // is there a way to do this with out multiple trips to the DOM?
}


[jQuery] Re: jquery not working at all after upgrade to 1.3.1

2009-01-23 Thread seasoup

Well, one issue might be that you are using onload in the body tag why
not use the jQuery ready function that you are already using above?

$(document).ready(function(){
  $('#gid3').flexigrid();
  DynarchMenu.setup('hmenu_01',{
context: true,
electric: 500,
tooltips: true
  });
  FormUtil.focusOnFirst('ttr01_con0');
  DynarchMenu.setup('hmenu_02',{
electric: true
  });
  FormUtil.focusOnFirst(document)
});

Same with the unload in the body tag.

$(document).unload(function(){
  $('#gid3').flexDestroy();
}
On Jan 23, 9:04 am, Jay  wrote:
> Unfortunately, no, classified type site.  Here is code though with
> details removed that may be problematic. There are 2 function using
> jquery, flexigrid, and a function I wrote called flexDestroy.
>
> This is the same error I get when I was building the app and the id,
> gid3 in this case, did not exist on the page.  It does exist, but is
> hidden. I tried unhiding it and it didnt change anything. I can toggle
> between 1.2.6 and 1.3.1 and watch as it works, then doesn't work.
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>  language="JavaScript">
> function columnMove(order,scope){
>             var params = "";
>             if(scope != null)
>             {
>               params += "&page_scope=" + scope;
>             }
>             $.ajax({
>             type: "GET",
>             url: "",
>             data: params
>             });
>           };;
> 
> $
> (document).ready(function(){$('#gid3').flexigrid();});
>
> 
> 
>
> 
>
> On Jan 23, 11:35 am, Mike Alsup  wrote:
>
> > > I have various jquery apps.  In 1.3.1 I get the error "$
> > > ('#id3').functionName is not a function.
>
> > > I switch to 1.2.6 and everything works fine.  Anyone else running into
> > > this?
>
> > Can you please post a link that demonstrates the problem you're having?


[jQuery] Re: I love jQuery fan logos

2009-01-23 Thread chrispie

ah nice! i was searching for a hq version. thx

On Jan 23, 3:37 pm, Brandon Aaron  wrote:
> Cool! BTW... You can find the official jQuery and jQuery UI logos 
> here:http://docs.jquery.com/Design_and_Identity :)
> --
> Brandon Aaron
>
> On Fri, Jan 23, 2009 at 7:35 AM, chrispie  wrote:
>
> > hey, i love jQuery so i made some "i love jQuery" logos for blogs or
> > what ever.
> > be proud and be a fan ;)
>
> >http://www.chrispie.de/apple/i-love-jquery-300/


[jQuery] Re: Having problems with 1.3 on Opera userjs

2009-01-23 Thread helianthus

anyone?

On 1月23日, 上午8時42分, helianthus  wrote:
> I have been writing a user-script(userjs) with jQuery recently, the
> way I integrate jQuery is to copy the minified code into the user-
> script.
> It had been working fine until I updated jQuery to 1.3, while on other
> browsers(FF3, Chrome, etc) they still work with no problems, on Opera
> 9.63 the page stops loading and stays blank.
>
> To test simply copy jquery-1.3.1.js into the userjs folder and go to
> any websites.
> With v1.2.6 no such problem appears.
>
> About how to use user-scripts on 
> Opera:http://www.opera.com/browser/tutorials/userjs/using/


[jQuery] Re: neccessity of binding update after adding html dynamically

2009-01-23 Thread jay

If you do:

$(anyElement).html("blah");

then you will need to do:
$('#bla').bind("click",function(){.});

after the html() call.

Does this answer your question?

On Jan 23, 11:30 am, aldana  wrote:
> I am binding elements inside document.ready():
> $('#bla').bind("click",function(){.});
>
> At some point html is added dynamically:
> anyElement.html=" "
>
> would then a callback added to the dom representation of the dynamically
> added snippet also or would i need again to call $('#bla').bind(...)?
>
> thanks.
>
> -
> manuel aldana
> aldana((at))gmx.de
> software-engineering blog:http://www.aldana-online.de
> --
> View this message in 
> context:http://www.nabble.com/neccessity-of-binding-update-after-adding-html-...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: change certain elements in result set based on position

2009-01-23 Thread devilmike

Awesome Ricardo, thanks! I guess the only issue I have is that I'll
never know how many "sets of 4" I'll be dealing with, and i apologize
for not explaining myself very well in my example. Basically for each
"set", I want to run the same function.  This is what I came up with.
It works, but I'm a bit concerned about the amount of looping going
on. Your code seems much cleaner...


var result = $('a');
var theCount = 4; //variable passed in
var oldCount = -1;
var theRow = result;

while (theRow.length > 1){
theRow = jQuery.grep(result, function(n, i){
return (n  && i < theCount && i > oldCount );
});
oldCount = theCount - 1;
theCount = theCount + 4;

$(theRow).each(function(i, o){
// do something to each item of each set
});
}


[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)

2009-01-23 Thread Nicolas R

@Cliff,
I remember that somewhere in the source there's provision for what
you're asking (the first version was like that). I'm also sure that
its not implemented and that it will require quite a bit of fiddling
to get it to work. I'll check the source and do some tests over the
weekend and if I have time I will do it, otherwise I'll post info on
how to do it yourself.

Sorry of not being able to help at the moment.

Nicolas

On Jan 23, 11:03 am, Cliff  wrote:
> Can you give me any hints on how I could modify this to read in the
> various levels from an existing  on the page?  Or form a set of
> nested 's or from provided XML?
>
> The reason I ask is that I think it is much easier to navigate this
> way from other tree based data, and if JS was disabled for a given
> page, you could still show the entire  as plaintext.


[jQuery] Re: Events. .click() vs. .onclick

2009-01-23 Thread KidsKilla .grin! wuz here

yeap, ill try to publish an example of the page tomorrow...

2009/1/23 Eric Garside :
>
> Do you have a public page somewhere that you're trying this? That'd be
> helpful in diagnosing the problem. Otherwise, we're shooting in the
> dark here.
>
> On Jan 23, 10:59 am, "KidsKilla .grin! wuz here" 
> wrote:
>> Should, but itn't! =(
>>
>> And I whanna know why...
>>
>> maybe some kind of flag...
>>
>> 2009/1/23 jay :
>>
>>
>>
>>
>>
>> > this should work:
>>
>> > $("#elementID").click(function(){alert('clicked')});
>>
>> > On Jan 23, 10:20 am, KidsKilla  wrote:
>> >> Hi everyone!
>> >> I have a problem with binding events in jQuery. I didn't figured out
>> >> why, but when i'm tryin to bind a callback to links ( $(elm).click
>> >> (function() ), it doesn't works. but works fine with
>> >> elm.onclick = function() ...
>>
>> >> the same thing in 1.2.6 and 1.3.1, IE and FF...
>>
>> >> The question is: what can it be? it seems like an error with innerHTML
>> >> or somethng else, but I cant find out what happening...
>>
>> --
>> Максим Игоревич Гришаев,
>> AstroStar.ru



-- 
Максим Игоревич Гришаев,
AstroStar.ru


[jQuery] Re: Looping JSON Data

2009-01-23 Thread Eric Garside

JSON is Javascript Object Notation, and is really text only. Once you
get JSON into javascript, it parses it into the object which it
defines. From that point on, you're just passing a regular object
around. There's technically no such thing as a "JSON" object.

Also, try running this code:

var listsData;

function getLists(){
   $.post( 'actions.php', {action: 'managelists'}, function(data){
   listsData = data.list;
   debugLists();
   }, 'json' )
}

function debugLists(){
$.each(listsData, function(){
alert(this.id + ': ' + this.name);
});
}

and see if that helps any?

On Jan 23, 12:04 pm, blockedmind  wrote:
> well, i tried some options more... it turns out when i set ajax data
> type to "text" and convert it to json object using json.parser() it
> works just fine. ok then its solved but i should be able to pass data
> as a json object between two functions, right?
>
> On Jan 23, 4:24 pm, blockedmind  wrote:
>
> > it returns
> > uncaught exception TypeError: Cannot read property 'length' of
> > undefined
> > error on google chrome's javascript debug window.
>
> > let me put here the full scenario:
>
> > var listsData="";
> > function getLists() {
> >     $.ajax({
> >        type: "POST",
> >        url: "actions.php",
> >        data: "action=managelists",
> >        success: function(returnedLists){
> >          listsData = returnedLists;
> >          printLists("ID","ASC");
> >        }
> >     });}
>
> > function printLists(sortBy,sortOption) {
> >     //$('#listlist .listdata').html(listsData);
> >     listsData=listsData['list'];
> >     $.each(listsData,function (a,b,c) {
> >         alert (b.id + ',' + b.name);
> >     });
>
> > }
>
> > so getList() function can successfully get the data i have wrote in
> > the first message. it is assigned to listsData and also passed
> > successfully to printLists function.
> > can it be the reason that i do not use dataType: "json" in the
> > getLists function? or what else? it seems so correct but it doesnt
> > work. :/
>
> > On Jan 22, 7:18 am, seasoup  wrote:
>
> > > or...
>
> > > $.each(theList.list,function (a,b) {
> > >   alert (b.id + ',' + b.name);
>
> > > })
>
> > > On Jan 21, 7:30 pm, Ami  wrote:
>
> > > > I think that this what R U searching for:
>
> > > > var theList={"list":[
> > > > {"id":"15","name":"Testing","description":"test","owner":"1","active":"1","featured":"0","machinename":"testing"},
> > > > {"id":"16","name":"Testing","description":"test","owner":"1","active":"1","featured":"0","machinename":"testing"},
> > > > {"id":"17","name":"Testing","description":"test","owner":"1","active":"1","featured":"0","machinename":"testing"}
> > > > ]};
>
> > > > theList=theList['list'];
> > > > $.each(theList,function (a,b,c)
> > > > {
> > > > alert (b.id + ',' + b.name);
>
> > > > })
>
> > > > On Jan 22, 4:46 am, blockedmind  wrote:
>
> > > > > I have data recieved by ajax function of jquery like:
> > > > > {"list":[
> > > > > {"id":"17","name":"Testing","description":"test","owner":"1","active":"1","featured":"0","machinename":"testing"},
> > > > > {"id":"16","name":"Another
> > > > > List","description":"Another","owner":"1","active":"1","featured":"0","machinename":"another-
> > > > > list"},
> > > > > {"id":"15","name":"Listenin
> > > > > Adı","description":"Yeah.","owner":"1","active":"1","featured":"0","machinename":"listenin-
> > > > > adi"},
> > > > > ]};
>
> > > > > how can i print each "list" in aloop? i tried many variations,
> > > > > couldn't get the result.


[jQuery] Re: run function when 'each' is done, how?

2009-01-23 Thread Eric Garside

Yup, Ricardo's got it. In Javascript, everything runs in as it's
called, and will not continue to the next action until the current one
is complete. So if you have something like:

var num = 0;
for (var i =0; i< 1; ++i){
num += i;
}
alert(num);

Num will properly display whatever the value of that works out to be.
Also, your browser will hang for a while as it does the calculations.

The only time this doesn't hold true, where processing is done outside
the standard flow, is in a "thread" created by a setTimeout/
setInterval.

[ function() ]
  |
 for()
  |
 alert()
  |
 setTimeout() --- for() [w/callback]
  |  |
 alert()  callback()
  |
 done()


On Jan 23, 11:57 am, Ricardo Tomasi  wrote:
> Isn't it the same as doing this?
>
> $('span.countdown').each(function(){...});
> updateCounter();
>
> The updateCounter function will only run after each() has returned/
> finished.
>
> On Jan 23, 2:43 pm, Ariel Flesler  wrote:
>
> > if( $('span.countdown').length ){
> >  updateCounter();
>
> > }
>
> > --
> > Ariel Fleslerhttp://flesler.blogspot.com
>
> > On 23 ינואר, 11:39, johannesf  wrote:
>
> > > Hi
>
> > > jquery is fantastic :-)
>
> > > My problem: I have a simple each-loop and after the loop I want to run a
> > > js-function.
>
> > > How can I determine when the each-loop is done in a more elegant way then
> > > this!
>
> > > -
>
> > > var flag = false;
>
> > > $('span.countdown').each(function(){
>
> > >     flag = true;
>
> > > });
>
> > > // when the loop is done, run 'updateCounter()'
> > > if(flag == true){
>
> > >     updateCounter();        
>
> > > }
>
> > > all the best / johannes
>
> > > --
> > > View this message in 
> > > context:http://www.nabble.com/run-function-when-%27each%27-is-done%2C-how--tp...
> > > Sent from the jQuery General Discussion mailing list archive at 
> > > Nabble.com.


  1   2   >