[jQuery] SITE SUBMISSION: Please add www.paddockcleaner.com.au to the list of sites

2007-07-25 Thread Joel Birch


Me again :)

Here is another (fairly basic) site I just recently designed and  
developed.

www.paddockcleaner.com.au
The site needed to be done to a budget so liberal use of plugins made  
it possible to add bells and whistles unobtrusively without spending  
too much time.


- Mike Alsup's amazing Media Plugin used to embed video upon click of  
the video image on the gallery page.
- My own unreleased "Showoff" plugin. Think "Innerfade" but even  
lighter in weight and with more functionality (custom animations,  
pause, resume, looping/non-looping, etc) and can be used for both  
slideshows and galleries - an example of each is included on the  
Gallery page of the site. I'd release the plugin but because it is so  
flexible the documentation side of it would be heaps of work that I  
haven't found time for. A good knowledge of CSS is required to use  
its more advanced features also.
- A slightly modified version of Klaus and Cody's "Smoother  
Thickbox". I found that Klaus's method of IE fixed positioning does  
not work with jQuery 1.1.3.1 which is why I had to use 1.1.2 for this  
site.

- table striping

Joel Birch.

P.S. I do use colours other than green... honest! ;)


[jQuery] Re: [ANNOUNCE] jCarouselLite version 0.4.0

2007-07-25 Thread Mike Fern

Hi Ganeshji,

Great plugin. It will be great if there is also an option for looping
without the scrolling back effect.

Regards,
Mike


[jQuery] Re: jCarouselLite version 0.4.0

2007-07-25 Thread Ganeshji Marwaha

glad u like it... thanks for the compliment.

-GTG


On 7/25/07, Jarod <[EMAIL PROTECTED]> wrote:



cheers.
i like this plugins. it's very easy to use.

On Jul 26, 6:28 am, "Ganeshji Marwaha" <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I have updated the jCarouselLite plugin to its next revision - 0.4.0
> . The project page is
athttp://www.gmarwaha.com/jquery/jcarousellite/index.php
>
> This revision adds a few cool features(based on demand) and fixes a few
> bugs. It looks pretty stable now. If it stays stable for sometime, i
might
> raise it to 1.0 status pretty soon.
>
> 1. Added support for mouse-wheel interaction. By adding
"mouseWheel:true" to
> your list of options, you can scroll your mouse-wheel and navigate the
> carousel.
> 2. Added support for auto-scroll. You can specify a delay between 2
> subsequent scrolls in the "auto" option, and your carousel will
magically
> keep scrolling
> 3. The mouseWheel, autoScroll and button based navigation are not
mutually
> exclusive. You can use all three with the same carousel if you want.
> 4. Added support
> for scrolling more than one item at a time. Just add "scroll:
> someNumber" here to scroll that many items per unit of navigation.
> 5. Fixed bugs that were both reported here on the list and sent to my
> personal email. Thanks guys for all your feedback.
> 6. Added 3 more demos to the project page, improved the documentation
and
> installation sections. The changelog and known-issues sections are also
> updated. So, you should get a pretty accurate picture of the project's
> current status there.
>
> The best part is, it is still approximately 1.9 KB light (compressed).
>
> I would be glad to hear some feedback.
>
> -GTG




[jQuery] SITE SUBMISSION: Please add www.fppdesign.com.au to the list of sites

2007-07-25 Thread Joel Birch


Hi Rey,

I was hoping you could add www.fppdesign.com.au - a site I did over a  
year ago. This site has used jQuery since before there was a jQuery  
version number! Over time, I have added quite a few jQuery  
enhancements including:


- Rounded Corners plugin by Dave Methvin to round off the active  
navigation tab
- My jQuery port of Dustin Diaz's SweetTitles (is it worth officially  
releasing that as a plugin?) to provide stylised tooltips that fade in.

- AHAH retrieved email address inspired by "15 Days of jQuery".
- ScrollTo stuff taken from Interface to animate the "Back to top" link.
- YShout5, a "PHP and Ajax Shoutbox" that uses jQuery, by Yuri  
Vishnevsky. Creates an instant message box on the page so users of a  
page can chat in realtime. This is really just a gimmick but the  
client likes it and I really wanted to implement it just for fun.

- Rudimentary client-side email validation.

Cheers Rey,

Joel Birch.


[jQuery] Re: [ANNOUNCE] jCarouselLite version 0.4.0

2007-07-25 Thread Ganeshji Marwaha

Rey,

I sure will do it, but since all the demos are in php files right now, i
might need some time to make a zip of all the demos and docs.
I will give it a shot over the weekend and let you know...  is that fine
with u...

BTW, if i have to make jCarouselLite available via jquery svn whom should i
ask to get a userId for myself.?

-GTG


On 7/25/07, Rey Bango <[EMAIL PROTECTED]> wrote:



Ganeshji,

Would you mind terribly zipping up all of the files, demos and docs so I
can download everything at one time?

I'd like to keep a local copy of everything for archival purposes.

Rey...

Ganeshji Marwaha wrote:
> Hi list,
>
> I have updated the jCarouselLite plugin to its next revision -
> 0.4.0. The project page is at
http://www.gmarwaha.com/jquery/jcarousellite/index.php
> 
>
> This revision adds a few cool features(based on demand) and fixes a few
> bugs. It looks pretty stable now. If it stays stable for sometime, i
> might raise it to 1.0 status pretty soon.
>
> 1. Added support for mouse-wheel interaction. By adding
> "mouseWheel:true" to your list of options, you can scroll your
> mouse-wheel and navigate the carousel.
> 2. Added support for auto-scroll. You can specify a delay between 2
> subsequent scrolls in the "auto" option, and your carousel will
> magically keep scrolling
> 3. The mouseWheel, autoScroll and button based navigation are not
> mutually exclusive. You can use all three with the same carousel if you
> want.
> 4. Added support
> for scrolling more than one item at a time. Just add "scroll:
someNumber" here to scroll that many items per unit of navigation.
> 5. Fixed bugs that were both reported here on the list and sent to my
> personal email. Thanks guys for all your feedback.
> 6. Added 3 more demos to the project page, improved the documentation
> and installation sections. The changelog and known-issues sections are
> also updated. So, you should get a pretty accurate picture of the
> project's current status there.
>
> The best part is, it is still approximately 1.9 KB light (compressed).
>
> I would be glad to hear some feedback.
>
> -GTG
>

--
BrightLight Development, LLC.
954-323-2225 (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com



[jQuery] datePicker plugin inline

2007-07-25 Thread Larry Garfield

Hello, jQuery.  My apologies if this is a dupe; the first copy didn't seem to 
go through.

I'm working with Kevin Luck's datePicker plugin, v2[1], because it seemed the 
least unsuited for what I was trying to do and I'm already using it 
elsewhere.  What I'm trying to do is have an inline calendar grid rather than 
a popup, and have that inline grid offer paging and multi-select 
abilities.  Then on submit, grab all of the selected dates and serialize them 
to a hidden field and submit.  I'm replacing a YUI widget that did that, but 
did so only on certain systems when it was in certain moods, making it far 
too unreliable.

According to the docs, I can get paging and multi-select in a popup 
easily[2].  I can also render an inline calendar instead[3].  What I have 
found no documentation on and have been unable to do myself is get both to 
happen at the same time.  If I render my own calendar, it gets no paging, no 
select ability at all; it's really just a static read-only display.  I've 
looked at the plugin's source, but haven't been able to find any indication 
of what I'd need to copy out or reference directly in order to get 
the "picker" parts of datePicker.  

Any tips on how to have my picker and see it, too, would be most 
appreciated.  Samples of working code would be even better. :-)  Thanks.


[1] http://kelvinluck.com/assets/jquery/datePicker/v2/demo
[2] 
http://kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiple.html
[3] http://kelvinluck.com/assets/jquery/datePicker/v2/demo/renderCalendar.html

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


[jQuery] Re: [ANNOUNCE] jCarouselLite version 0.4.0

2007-07-25 Thread Rey Bango


Ganeshji,

Would you mind terribly zipping up all of the files, demos and docs so I 
can download everything at one time?


I'd like to keep a local copy of everything for archival purposes.

Rey...

Ganeshji Marwaha wrote:

Hi list,

I have updated the jCarouselLite plugin to its next revision - 
0.4.0. The project page is at http://www.gmarwaha.com/jquery/jcarousellite/index.php 



This revision adds a few cool features(based on demand) and fixes a few 
bugs. It looks pretty stable now. If it stays stable for sometime, i 
might raise it to 1.0 status pretty soon.


1. Added support for mouse-wheel interaction. By adding 
"mouseWheel:true" to your list of options, you can scroll your 
mouse-wheel and navigate the carousel.
2. Added support for auto-scroll. You can specify a delay between 2 
subsequent scrolls in the "auto" option, and your carousel will 
magically keep scrolling
3. The mouseWheel, autoScroll and button based navigation are not 
mutually exclusive. You can use all three with the same carousel if you 
want.
4. Added support 
for scrolling more than one item at a time. Just add "scroll: someNumber" here to scroll that many items per unit of navigation. 
5. Fixed bugs that were both reported here on the list and sent to my 
personal email. Thanks guys for all your feedback.
6. Added 3 more demos to the project page, improved the documentation 
and installation sections. The changelog and known-issues sections are 
also updated. So, you should get a pretty accurate picture of the 
project's current status there.


The best part is, it is still approximately 1.9 KB light (compressed).

I would be glad to hear some feedback. 

-GTG 



--
BrightLight Development, LLC.
954-323-2225 (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Joel Birch


Ha, you beat me by "this much", Karl. Plus yours works, whereas mine  
is missing a dollar sign right before document ready :(


Joel.


On 26/07/2007, at 2:36 PM, Karl Swedberg wrote:

I didn't make it simpler, really, but I did optimize it a bit.

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com




[jQuery] Re: jCarouselLite version 0.4.0

2007-07-25 Thread Jarod

cheers.
i like this plugins. it's very easy to use.

On Jul 26, 6:28 am, "Ganeshji Marwaha" <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I have updated the jCarouselLite plugin to its next revision - 0.4.0
> . The project page is athttp://www.gmarwaha.com/jquery/jcarousellite/index.php
>
> This revision adds a few cool features(based on demand) and fixes a few
> bugs. It looks pretty stable now. If it stays stable for sometime, i might
> raise it to 1.0 status pretty soon.
>
> 1. Added support for mouse-wheel interaction. By adding "mouseWheel:true" to
> your list of options, you can scroll your mouse-wheel and navigate the
> carousel.
> 2. Added support for auto-scroll. You can specify a delay between 2
> subsequent scrolls in the "auto" option, and your carousel will magically
> keep scrolling
> 3. The mouseWheel, autoScroll and button based navigation are not mutually
> exclusive. You can use all three with the same carousel if you want.
> 4. Added support
> for scrolling more than one item at a time. Just add "scroll:
> someNumber" here to scroll that many items per unit of navigation.
> 5. Fixed bugs that were both reported here on the list and sent to my
> personal email. Thanks guys for all your feedback.
> 6. Added 3 more demos to the project page, improved the documentation and
> installation sections. The changelog and known-issues sections are also
> updated. So, you should get a pretty accurate picture of the project's
> current status there.
>
> The best part is, it is still approximately 1.9 KB light (compressed).
>
> I would be glad to hear some feedback.
>
> -GTG



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Joel Birch


On 26/07/2007, at 1:42 PM, Mitchell Waite wrote:

I defy anyone to make this simpler (and work as well)!


This may or may not look simpler, but its more optimised and more  
maintainable :)


(document).ready(function(){

var myClass = "hidden",
$hov = $("#hover"),
$norm = $("#normal");

$("#showPic")
.hover(function() {
$hov.removeClass(myClass);
}, function() {
$hov.addClass(myClass);
})
.mousedown(function() {
$hov.addClass(myClass);
$norm.addClass(myClass);
})
.mouseup(function() {
$norm.removeClass(myClass);
});

});

Joel.


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Karl Swedberg

I didn't make it simpler, really, but I did optimize it a bit.

Here only three jQuery objects are created, as opposed to eight in  
your example.


$(document).ready(function(){
   var $hover = $('#hover');
   var $normal = $('#normal');

$("#showPic").hover(function() {
$hover.removeClass("hidden");
}, function() {
$hover.addClass("hidden");
})
.mousedown(function() {
$hover.addClass("hidden");
$normal.addClass("hidden");
})
.mouseup(function() {
$normal.removeClass("hidden");
});
});



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jul 25, 2007, at 11:42 PM, Mitchell Waite wrote:


I defy anyone to make this simpler (and work as well)!



A true 3 state button



http://www.whatbird.com/wwwroot/3statebutton_6.html



(document).ready(function(){



$("#showPic").hover(function() {

$("#hover").removeClass("hidden");

}, function() {

$("#hover").addClass("hidden");

});



$("#showPic").mousedown(function() {

$("#hover").addClass("hidden");

$("#normal").addClass("hidden");

});



$("#showPic").mouseup(function() {

$("#normal").removeClass("hidden");

});



});



From: jquery-en@googlegroups.com [mailto:jquery- 
[EMAIL PROTECTED] On Behalf OfMitchell Waite

Sent: Wednesday, July 25, 2007 7:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and  
hide




Ok here is the skinny (I think I am getting this down)



http://www.whatbird.com/wwwroot/3statebutton_3.html (uses layers)



$(document).ready(function(){

$("#showPic").hover(function() {

$("#normal").addClass("hidden");

}, function() {

$("#normal").removeClass("hidden");

});

});



The hover button is under the normal button layer so all we have to  
do is hide and unhide the normal button.




http://www.whatbird.com/wwwroot/3statebutton_4.html (no layers)



$(document).ready(function(){

$("#showPic").hover(function() {

$("#hover").removeClass("hidden");

$("#normal").addClass("hidden");

}, function() {

$("#hover").addClass("hidden");

$("#normal").removeClass("hidden");

});

});



Since both bottons are in the same div they can’t both be on at the  
same , or you would see them side by side. So you hide and unhide  
both buttons. More processing but less divs.




Mitch










[jQuery] Re: Superfish with interface plugin ...

2007-07-25 Thread Joel Birch


On 26/07/2007, at 1:57 AM, TiGeRWooD wrote:

Hi,

I tried to used superfish, but i have a bug in IE7 (not tried in ie6),
superfish doesn't work well if the interface plugin is loaded ...

the first submenu are visible but the sub sub menu don't ...

If anyone have ideas ... you 're welcome :)

Thanks in advance.


I haven't used Interface and this is the first I've heard of there  
being a problem with using it with Superfish so I may not be much  
help. I can't think of why the display of the sub sub menus would be  
affected by the presence of another script like Interface. Are you  
sure some other CSS that you are using with Interface isn't seeping  
into the Superfish menu? Does the problem occur by merely linking to  
Interface? Have you tried maybe including Superfish after Interface  
in the source order? Could you create a simple test page for us to  
look at?


Joel Birch.


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mitchell Waite
BTW feel free to use my quote in any marketing your publisher or you do.
Viral is the way to go with this new computer book market.

 

I will get right over to your web site now. Wow nice! This is so helpful. 

 

May I ask about the reference guide. Is that a work in process? Is it okay
to look at it?

 

I am making good progress in the lessons. I was able to solve a big puzzle
today on DOM vs jQuery and discovered that there are cool ways to do things
in jQuery and there are ways to just get things down. I'm more in the 2nd
group. 

 

I was able to finally figure out how to make 3 state button using addclass.
I got a lot of help here from the experts, especially Rob Desbois and
Michael Geary. 

 

http://www.whatbird.com/wwwroot/3statebutton_6.html

 

Are you on the CBT list?

 

Mitch

 

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Wednesday, July 25, 2007 7:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

On Jul 25, 2007, at 8:18 PM, Mitchell Waite wrote:

Gosh the author speaks!

Yes, I do. Usually, I speak too much. ;-)

 

 Having authored about 25 computer books on programming and published about
200 (www.mitchwaite.com), I find Learning jQuery a real treasure. The way
you guys tell the store is very well thought out, and shows an immense
understanding of the person coming to jQuery. You go out of your way to help
understand what makes it so different.

 

Mitch, thanks a lot for the feedback on the book. I'm thrilled to know that
you're enjoying it. I checked out your site when you first made an
appearance on this list and ... Wow! You are prolific! And a real pioneer.
Very impressive.

I just hit chapter 4 page 67 were you introduce css positioning so I can
being to see the use of styles better. The link on page 67 is broken.

Sorry about that! They must have shifted their site around since we last
checked. Anyway, here is a working link:

http://www.wpdfd.com/issues/78/absolutely_relative/





Is there source code for the examples anywhere. It would be so helpful to be
able to run each example and modify it.

Yes, you can grab the source download or post errata at the publisher's
website:

http://www.packtpub.com/support/book/jQuery

 

Also, we threw everything onto http://book.learningjquery.com/ in case you
want to just see everything in action. I just created a forum there, too, in
case someone stumbles upon the site and wants to provide some feedback,
etc.: http://book.learningjquery.com/forums/



 My only quibble and this is more the publisher in me, is that the book
suffers on the illustration end. I think there are a lot of places where a
drawing or two would have hammered the idea home.

Excellent point. Also, as has been discussed in another thread, some of the
pictures in the first few chapters didn't translate to grayscale very well
at all. 

 

Thanks again for the comments!

 

Karl



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mitchell Waite
I defy anyone to make this simpler (and work as well)!

 

A true 3 state button

 

http://www.whatbird.com/wwwroot/3statebutton_6.html

 

(document).ready(function(){

 

$("#showPic").hover(function() {

$("#hover").removeClass("hidden");

}, function() {

$("#hover").addClass("hidden");

}); 



$("#showPic").mousedown(function() {

$("#hover").addClass("hidden");

$("#normal").addClass("hidden");

});   



$("#showPic").mouseup(function() {

$("#normal").removeClass("hidden");

});   

 

});  

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mitchell Waite
Sent: Wednesday, July 25, 2007 7:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

Ok here is the skinny (I think I am getting this down)

 

http://www.whatbird.com/wwwroot/3statebutton_3.html (uses layers)

 

$(document).ready(function(){ 

$("#showPic").hover(function() {

$("#normal").addClass("hidden");

}, function() {

$("#normal").removeClass("hidden");

}); 

});  

 

The hover button is under the normal button layer so all we have to do is
hide and unhide the normal button.

 

http://www.whatbird.com/wwwroot/3statebutton_4.html (no layers)

 

$(document).ready(function(){ 

$("#showPic").hover(function() {

$("#hover").removeClass("hidden");

$("#normal").addClass("hidden");

}, function() {

$("#hover").addClass("hidden");

$("#normal").removeClass("hidden");

}); 

});  

 

Since both bottons are in the same div they can't both be on at the same ,
or you would see them side by side. So you hide and unhide both buttons.
More processing but less divs.

 

Mitch

 

 



[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Jonathan Sharp

Do you have a url to a sample page we could look at?

-js


On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote:


Thanks Jonathan

Almost but still not working

$('.collapsible .collapsed').bind('click', function() {

$(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen');

});

I said too

I have many .collapsible .collapsed classes so I cant change all at the
same time. Ideas?

So when I use your idea my All "tree" open and if I click again all close.
Works fine in main root.

Can I set in $(this) to apply this JQuery only in the real clicked
"element"? I am trying some XPath Selectors. Could you help me?

Cheers ;)

Mario


2007/7/25, Jonathan Sharp <[EMAIL PROTECTED]>:
>
> The issue lies in that you're trying to bind your click event to
> .collapsibleopen at document ready time. The .collapsibleopen class won't be
> available until the user clicks to have it added. I think below is more of
> what you're after...
>
> $('.collapsible .collapsed .collapsibleopen').bind('click', function() {
>
> 
$(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen');
> });
>
> Cheers,
> -js
>
>
> On 7/25/07, Mario Moura < [EMAIL PROTECTED]> wrote:
> >
> > Hi Folks
> >
> > I am trying switch between two class
> >
> > Is it possible?
> >
> >
> > $(document).ready(function(){
> >
> >  $(".collapsible .collapsed").click(function(){
> > $(this).removeClass().addClass("collapsibleopen");
> >  });
> >
> >  $("collapsibleopen").click(function(){
> > $(this).removeClass().addClass("collapsible collapsed");
> >  });
> >
> >  });
> >
> > My first switch works but when I click in collapsibleopen (change from
> > the previous click) didnt change.
> >
> > I have many .collapsible .collapsed classes so I cant change all at
> > the same time. Ideas?
> >
> > Regards
> >
> > --
> > Mário
>
>
>


--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Karl Swedberg

On Jul 25, 2007, at 8:18 PM, Mitchell Waite wrote:

Gosh the author speaks!

Yes, I do. Usually, I speak too much. ;-)

 Having authored about 25 computer books on programming and  
published about 200 (www.mitchwaite.com), I find Learning jQuery a  
real treasure. The way you guys tell the store is very well thought  
out, and shows an immense understanding of the person coming to  
jQuery. You go out of your way to help understand what makes it so  
different.


Mitch, thanks a lot for the feedback on the book. I'm thrilled to  
know that you're enjoying it. I checked out your site when you first  
made an appearance on this list and ... Wow! You are prolific! And a  
real pioneer. Very impressive.
I just hit chapter 4 page 67 were you introduce css positioning so  
I can being to see the use of styles better. The link on page 67 is  
broken.
Sorry about that! They must have shifted their site around since we  
last checked. Anyway, here is a working link:

http://www.wpdfd.com/issues/78/absolutely_relative/

Is there source code for the examples anywhere. It would be so  
helpful to be able to run each example and modify it.
Yes, you can grab the source download or post errata at the  
publisher's website:

http://www.packtpub.com/support/book/jQuery

Also, we threw everything onto http://book.learningjquery.com/ in  
case you want to just see everything in action. I just created a  
forum there, too, in case someone stumbles upon the site and wants to  
provide some feedback, etc.: http://book.learningjquery.com/forums/
 My only quibble and this is more the publisher in me, is that the  
book suffers on the illustration end. I think there are a lot of  
places where a drawing or two would have hammered the idea home.
Excellent point. Also, as has been discussed in another thread, some  
of the pictures in the first few chapters didn't translate to  
grayscale very well at all.


Thanks again for the comments!

Karl

[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mitchell Waite
Ok here is the skinny (I think I am getting this down)

 

http://www.whatbird.com/wwwroot/3statebutton_3.html (uses layers)

 

$(document).ready(function(){ 

$("#showPic").hover(function() {

$("#normal").addClass("hidden");

}, function() {

$("#normal").removeClass("hidden");

}); 

});  

 

The hover button is under the normal button layer so all we have to do is
hide and unhide the normal button.

 

http://www.whatbird.com/wwwroot/3statebutton_4.html (no layers)

 

$(document).ready(function(){ 

$("#showPic").hover(function() {

$("#hover").removeClass("hidden");

$("#normal").addClass("hidden");

}, function() {

$("#hover").addClass("hidden");

$("#normal").removeClass("hidden");

}); 

});  

 

Since both bottons are in the same div they can't both be on at the same ,
or you would see them side by side. So you hide and unhide both buttons.
More processing but less divs.

 

Mitch

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Brandon Aaron
Sent: Wednesday, July 25, 2007 5:17 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

The hover method takes two functions. One for the mouseover and one for the
mouseout. Here are the docs for the hover method:
http://jquery.bassistance.de/api-browser/#hoverFunctionFunction 

Here is the proper way to code the example.

$("#showPic").hover(function() {
$("#hover, #normal").addClass("hidden");
}, function() {
$("#hover, #normal").removeClass("hidden");
}); 

--
Brandon Aaron

On 7/25/07, Mitchell Waite <[EMAIL PROTECTED]> wrote:

Leave it to Michael to leave the most indelible mark. I now a see the subtle
issues with "this" In fact I have a whole a new take on jQuery since
listening to Michael about "this" and trying to get my tediously simple
little toggle to work. 

 

It actually started in Javascript and was a lot more code, so I appreciate
that it's so more streamlined. 

 

However the abstraction leaves me a bit uneasy. Given there is no simple way
to tell a DOM "this" from a jQ "this", I ended up doing this:

 

 

/* from Rob */

function toggleVis(element) { 

if (element.style.visibility == 'hidden') {  

element.style.visibility = 'visible'; 

} else { 

element.style.visibility = 'hidden'; 

} 

} 

 

Contrasting this with Michael G's code

 

   jQuery.fn.toggleVis = function() {

  return this.each( function( index, element ) {

 if (element.style.visibility == 'hidden') {

element.style.visibility = 'visible';

 } else {

element.style.visibility = 'hidden';

 }

  });

   };

 

I think Rob's makes more sense to a beginner. 

 

 called by this

 

 $("#toggle").click(function() { 

  var $cat = $('#cheshireCat');  

  if ($cat.length) { 

 toggleVis($cat[0]); 

   } 

  });

 

This was advice from Rob, using a JS function and calling it with from
jQuery and sending it a DOM. I leave this here for the newbie's on this
list, as I know this is self evident to most people here.  

 

Now to muddle things either further.

 

I decided that I might be able to use jQuery's 'hover' to deal with the
whole issue of flipping visibility and so I made this:

 

.hidden {display: none;}

 

.showPic {

   position:absolute;

   width:94px;

   height:31px;

   z-index:1;

}

 



 



$(document).ready(function(){

 

   $("#showPic").hover(function() {

  $("#hover, #normal").toggleClass("hidden");

}); 

 

});  

 

 



 









 





 

Ya think that could be more simple. It works right?

 

Check it out, it does something much different then what I expected.

 

http://www.whatbird.com/wwwroot/3statebutton_2.html

 

So is hover not a good solution?

 

Mitch

 

-Original Message-
From: jquery-en@googlegroups.com [mailto:
  [EMAIL PROTECTED] On Behalf
Of Michael Geary
Sent: Wednesday, July 25, 2007 10:10 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

 

Rob, I think you left out the return statement that you meant to put in. :-)

 

(Outstanding explanation, BTW!)

 

For clarity, it could be:

 

   jQuery.fn.toggleVis = function() {

  this.each(function() {

 if (this.style.visibility == 'hidden') {

this.style.visibility = 'visible';

 } else {

this.style.visibility = 'hidden';

 }

  });

  return this;

   };

 

 

 



[jQuery] Re: jQuery AJAX working in Firefox but not IE

2007-07-25 Thread Benjamin Sterling

Josh,
First, I am curious why you are putting the code directly on a like, is
there a reason for that?  I assume it is to be able to dynamically add the
IDs, but you should be able to create a function and just pass those IDs.

But, to actually answer your question, I could not find a good answer for
you, but this link may point you in the right direction:
http://www.thescripts.com/forum/thread424606.html  The second and third post
should shed some light.

The .load() uses innerHTML.

On 7/25/07, Josh A. <[EMAIL PROTECTED]> wrote:



Hey folks,

So here's example code:



You can see it in action (or inaction using IE) at
http://delangeracing.com/points
and clicking any "Prev" link.

Any idea why it never fades back in using IE?

-Josh





--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mitchell Waite
That won't work, it makes both buttons disappear and reappear instead of the
effect I want which is to make the hover button appear when the mouse is in
and disappear when the mouse is out.

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Brandon Aaron
Sent: Wednesday, July 25, 2007 5:17 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

The hover method takes two functions. One for the mouseover and one for the
mouseout. Here are the docs for the hover method:
http://jquery.bassistance.de/api-browser/#hoverFunctionFunction 

Here is the proper way to code the example.

$("#showPic").hover(function() {
$("#hover, #normal").addClass("hidden");
}, function() {
$("#hover, #normal").removeClass("hidden");
}); 

--
Brandon Aaron

On 7/25/07, Mitchell Waite <[EMAIL PROTECTED]> wrote:

Leave it to Michael to leave the most indelible mark. I now a see the subtle
issues with "this" In fact I have a whole a new take on jQuery since
listening to Michael about "this" and trying to get my tediously simple
little toggle to work. 

 

It actually started in Javascript and was a lot more code, so I appreciate
that it's so more streamlined. 

 

However the abstraction leaves me a bit uneasy. Given there is no simple way
to tell a DOM "this" from a jQ "this", I ended up doing this:

 

 

/* from Rob */

function toggleVis(element) { 

if (element.style.visibility == 'hidden') {  

element.style.visibility = 'visible'; 

} else { 

element.style.visibility = 'hidden'; 

} 

} 

 

Contrasting this with Michael G's code

 

   jQuery.fn.toggleVis = function() {

  return this.each( function( index, element ) {

 if (element.style.visibility == 'hidden') {

element.style.visibility = 'visible';

 } else {

element.style.visibility = 'hidden';

 }

  });

   };

 

I think Rob's makes more sense to a beginner. 

 

 called by this

 

 $("#toggle").click(function() { 

  var $cat = $('#cheshireCat');  

  if ($cat.length) { 

 toggleVis($cat[0]); 

   } 

  });

 

This was advice from Rob, using a JS function and calling it with from
jQuery and sending it a DOM. I leave this here for the newbie's on this
list, as I know this is self evident to most people here.  

 

Now to muddle things either further.

 

I decided that I might be able to use jQuery's 'hover' to deal with the
whole issue of flipping visibility and so I made this:

 

.hidden {display: none;}

 

.showPic {

   position:absolute;

   width:94px;

   height:31px;

   z-index:1;

}

 



 



$(document).ready(function(){

 

   $("#showPic").hover(function() {

  $("#hover, #normal").toggleClass("hidden");

}); 

 

});  

 

 



 









 





 

Ya think that could be more simple. It works right?

 

Check it out, it does something much different then what I expected.

 

http://www.whatbird.com/wwwroot/3statebutton_2.html

 

So is hover not a good solution?

 

Mitch

 

-Original Message-
From: jquery-en@googlegroups.com [mailto:
  [EMAIL PROTECTED] On Behalf
Of Michael Geary
Sent: Wednesday, July 25, 2007 10:10 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

 

Rob, I think you left out the return statement that you meant to put in. :-)

 

(Outstanding explanation, BTW!)

 

For clarity, it could be:

 

   jQuery.fn.toggleVis = function() {

  this.each(function() {

 if (this.style.visibility == 'hidden') {

this.style.visibility = 'visible';

 } else {

this.style.visibility = 'hidden';

 }

  });

  return this;

   };

 

 

 



[jQuery] Re: ANNOUNCEMENT: jQuery resetDefaultValue plugin

2007-07-25 Thread Erik Beeson

Then the filtering should be done on the selection end, not in the plugin.
Of course you can make your plugin do whatever you want, but for general
purpose use, there is an expectation that chainable functions won't modify
the chain (unless their specifically designed to like filter, find, etc).

It IS reasonable to have your plugin only operate on the subset of the
elements that it expects to operate on, but it should still return the same
set of elements that it was given.

--Erik


On 7/25/07, Leandro Vieira Pinho <[EMAIL PROTECTED]> wrote:



Hu, I don´t think it´s a good suggestion.

Imagine: I use the filter to avoid submit/reset/button buttons, for
example, so if I did it:

$('input').resetDefaultValue().height(30);

All the input elements affected by plugin will have 30 pixels of
height. If I use the .end() function, the submit/reset/buttons will
have 30 pixels of height too, so, but these kind of input elements isn
´s affected by plugin.

Do you agree?

On Jul 25, 4:07 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Leandro Vieira Pinho wrote:
> > Hi,
>
> > It´s a simple plugin, that let you clear and reset the value of input
> > elements.
>
> > Example of usage:
>
> > $(function() {
> >  $('input').resetDefaultValue(); // for all input elements
> >  $('input.className').resetDefaultValue(); // for some elements
> >  $('#q').resetDefaultValue(); // for a especific element
> > });
>
> > The plugin code:
>
> > /**
> >  * jQuery resetDefaultValue plugin
> >  * @version 0.9
> >  * @author Leandro Vieira Pinho <[EMAIL PROTECTED]>
> >  * How to use
> >  * $(function() {
> >  * $('input').resetDefaultValue(); // for all input elements
> >  *  $('input.className').resetDefaultValue(); // for some elements
> >  * $('#q').resetDefaultValue(); // for a especific element
> >  * });
> >  * ChangeLog
> >  * 0.1 - First relase
> >  * 0.2 - Filter input elements with type igual text, just it.
> >  * 0.9 - Rewrite all the plugin code. Thanks to Klaus Hartl [
> >http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd.
..
> > ]
> >  */
> > jQuery.fn.resetDefaultValue = function() {
> >function _clearDefaultValue() {
> >var _$ = $(this);
> >if ( _$.val() == this.defaultValue ) { _$.val(''); }
> >};
> >function _resetDefaultValue() {
> >var _$ = $(this);
> >if ( _$.val() == '' ) { _$.val(this.defaultValue); }
> >};
> >return
> > this.filter
('[EMAIL 
PROTECTED]').click(_clearDefaultValue).focus(_clearDefaultValue).blur(_resetDefaultValue);
> > }
>
> > The resetDefaultValue plugin has borned here:
> >http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd.
..
>
> Leandro,
>
> another thought: I think it is reasonable to filter the result set for
> the type, but you're also returning the filtered set, which kind of
> breaks chainability and might give unexpected results, as some elements
> are missing after your plugin's method in the chain.
>
> That said, here's what I propose:
>
> jQuery.fn.resetDefaultValue = function() {
> function _clearDefaultValue() {
> var _$ = $(this);
> if ( _$.val() == this.defaultValue ) { _$.val(''); }
> };
> function _resetDefaultValue() {
> var _$ = $(this);
> if ( _$.val() == '' ) { _$.val(this.defaultValue); }
> };
>
>  this
>  .filter('[EMAIL PROTECTED]')
>  .click(_clearDefaultValue)
>  .focus(_clearDefaultValue)
>  .blur(_resetDefaultValue);
>  return this;
>
> }
>
> Ah, or just add an end() at the end of the chain, that's shorter:
>
>  return this
>  .filter('[EMAIL PROTECTED]')
>  .click(_clearDefaultValue)
>  .focus(_clearDefaultValue)
>  .blur(_resetDefaultValue)
>  .end();
>
> Cheers, Klaus




[jQuery] jQuery AJAX working in Firefox but not IE

2007-07-25 Thread Josh A.

Hey folks,

So here's example code:



You can see it in action (or inaction using IE) at 
http://delangeracing.com/points
and clicking any "Prev" link.

Any idea why it never fades back in using IE?

-Josh



[jQuery] Re: ANNOUNCEMENT: jQuery resetDefaultValue plugin

2007-07-25 Thread Leandro Vieira Pinho

Hu, I don´t think it´s a good suggestion.

Imagine: I use the filter to avoid submit/reset/button buttons, for
example, so if I did it:

$('input').resetDefaultValue().height(30);

All the input elements affected by plugin will have 30 pixels of
height. If I use the .end() function, the submit/reset/buttons will
have 30 pixels of height too, so, but these kind of input elements isn
´s affected by plugin.

Do you agree?

On Jul 25, 4:07 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Leandro Vieira Pinho wrote:
> > Hi,
>
> > It´s a simple plugin, that let you clear and reset the value of input
> > elements.
>
> > Example of usage:
>
> > $(function() {
> >  $('input').resetDefaultValue(); // for all input elements
> >  $('input.className').resetDefaultValue(); // for some elements
> >  $('#q').resetDefaultValue(); // for a especific element
> > });
>
> > The plugin code:
>
> > /**
> >  * jQuery resetDefaultValue plugin
> >  * @version 0.9
> >  * @author Leandro Vieira Pinho <[EMAIL PROTECTED]>
> >  * How to use
> >  * $(function() {
> >  * $('input').resetDefaultValue(); // for all input elements
> >  *  $('input.className').resetDefaultValue(); // for some elements
> >  * $('#q').resetDefaultValue(); // for a especific element
> >  * });
> >  * ChangeLog
> >  * 0.1 - First relase
> >  * 0.2 - Filter input elements with type igual text, just it.
> >  * 0.9 - Rewrite all the plugin code. Thanks to Klaus Hartl [
> >http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd...
> > ]
> >  */
> > jQuery.fn.resetDefaultValue = function() {
> >function _clearDefaultValue() {
> >var _$ = $(this);
> >if ( _$.val() == this.defaultValue ) { _$.val(''); }
> >};
> >function _resetDefaultValue() {
> >var _$ = $(this);
> >if ( _$.val() == '' ) { _$.val(this.defaultValue); }
> >};
> >return
> > this.filter('[EMAIL 
> > PROTECTED]').click(_clearDefaultValue).focus(_clearDefaultValue).blur(_resetDefaultValue);
> > }
>
> > The resetDefaultValue plugin has borned here:
> >http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd...
>
> Leandro,
>
> another thought: I think it is reasonable to filter the result set for
> the type, but you're also returning the filtered set, which kind of
> breaks chainability and might give unexpected results, as some elements
> are missing after your plugin's method in the chain.
>
> That said, here's what I propose:
>
> jQuery.fn.resetDefaultValue = function() {
> function _clearDefaultValue() {
> var _$ = $(this);
> if ( _$.val() == this.defaultValue ) { _$.val(''); }
> };
> function _resetDefaultValue() {
> var _$ = $(this);
> if ( _$.val() == '' ) { _$.val(this.defaultValue); }
> };
>
>  this
>  .filter('[EMAIL PROTECTED]')
>  .click(_clearDefaultValue)
>  .focus(_clearDefaultValue)
>  .blur(_resetDefaultValue);
>  return this;
>
> }
>
> Ah, or just add an end() at the end of the chain, that's shorter:
>
>  return this
>  .filter('[EMAIL PROTECTED]')
>  .click(_clearDefaultValue)
>  .focus(_clearDefaultValue)
>  .blur(_resetDefaultValue)
>  .end();
>
> Cheers, Klaus



[jQuery] Re: Announce: Masked Input Plugin 1.0

2007-07-25 Thread Karl Swedberg

Fantastic, Josh! That is a thing of beauty.


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jul 25, 2007, at 8:21 PM, Josh Bush wrote:



I just wanted to announce that I've finally released v1.0 of my masked
input plugin.  Please check it out at:

http://digitalbush.com/projects/masked-input-plugin

Thank You
Josh
digitalbush.com





[jQuery] Announce: Masked Input Plugin 1.0

2007-07-25 Thread Josh Bush

I just wanted to announce that I've finally released v1.0 of my masked
input plugin.  Please check it out at:

http://digitalbush.com/projects/masked-input-plugin

Thank You
Josh
digitalbush.com



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mitchell Waite
Gosh the author speaks! 

 

Karl 

 

Having authored about 25 computer books on programming and published about
200 (www.mitchwaite.com), I find Learning jQuery a real treasure. The way
you guys tell the store is very well thought out, and shows an immense
understanding of the person coming to jQuery. You go out of your way to help
understand what makes it so different.

 

I just hit chapter 4 page 67 were you introduce css positioning so I can
being to see the use of styles better. The link on page 67 is broken. 

 

Is there source code for the examples anywhere. It would be so helpful to be
able to run each example and modify it.

 

My only quibble and this is more the publisher in me, is that the book
suffers on the illustration end. I think there are a lot of places where a
drawing or two would have hammered the idea home. 

 

I am really enjoying myself.

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Wednesday, July 25, 2007 10:15 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

On Jul 25, 2007, at 12:26 PM, Rob Desbois wrote:

I see now that an object in jQuery does not have a visibility directly, it
needs a class assigned to it, so that is why example 2 doesn't work.

Not entirely sure what you mean by this..? 





Well, the main point is that the jQuery object is not the same as a DOM
element. It doesn't necessarily need a class assigned to it to change the
visibility, but that's the approach we took in the early chapters of the
book to demonstrate basic jQuery components:
$('someSelector').addClass('class') and
$('someSelector').removeClass('class')

 

jQuery has its own method to access and modify CSS properties: .css(). 

 

So, $('#myDiv').css('visibility') would return the same value as
document.getElementById('myDiv').style.visibility

 

Except, I think, .css('visibility') will return "visible" if the element is
visible, even if its style attribute isn't explicitly set to "visiblity:
visible" whereas the .style.visibility will return "visible" only if that's
what the element's style attribute says.

 

I hope I'm not clouding the issue here. Ideally, modifying presentation
based on class as its defined in a stylesheet is the way to go. But,
Mitchell, I think you'll see later in the book (chapter 5?) that there are
times when it's necessary to calculate a css value in your script, so .css()
works great for those occasions.

 

--Karl

_

Karl Swedberg

www.englishrules.com

www.learningjquery.com

 





 

 



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Brandon Aaron

The hover method takes two functions. One for the mouseover and one for the
mouseout. Here are the docs for the hover method:
http://jquery.bassistance.de/api-browser/#hoverFunctionFunction

Here is the proper way to code the example.

$("#showPic").hover(function() {
   $("#hover, #normal").addClass("hidden");
}, function() {
   $("#hover, #normal").removeClass("hidden");
});

--
Brandon Aaron

On 7/25/07, Mitchell Waite <[EMAIL PROTECTED]> wrote:


 Leave it to Michael to leave the most indelible mark. I now a see the
subtle issues with "this" In fact I have a whole a new take on jQuery since
listening to Michael about "this" and trying to get my tediously simple
little toggle to work.



It actually started in Javascript and was a lot more code, so I appreciate
that it's so more streamlined.



However the abstraction leaves me a bit uneasy. Given there is no simple
way to tell a DOM "this" from a jQ "this", I ended up doing this:





/* from Rob */

function toggleVis(element) {

if (element.style.visibility == 'hidden') {

element.style.visibility = 'visible';

} else {

element.style.visibility = 'hidden';

}

}



Contrasting this with Michael G's code



   jQuery.fn.toggleVis = function() {

  return this.each( function( index, element ) {

 if (element.style.visibility == 'hidden') {

element.style.visibility = 'visible';

 } else {

element.style.visibility = 'hidden';

 }

  });

   };



I think Rob's makes more sense to a beginner.



 called by this



 $("#toggle").click(function() {

  var $cat = $('#cheshireCat');

  if ($cat.length) {

 toggleVis($cat[0]);

   }

  });



This was advice from Rob, using a JS function and calling it with from
jQuery and sending it a DOM. I leave this here for the newbie's on this
list, as I know this is self evident to most people here.



*Now to muddle things either further.*



I decided that I might be able to use jQuery's 'hover' to deal with the
whole issue of flipping visibility and so I made this:



.hidden {display: none;}



.showPic {

   position:absolute;

   width:94px;

   height:31px;

   z-index:1;

}









$(document).ready(function(){



   $("#showPic").hover(function() {

  $("#hover, #normal").toggleClass("hidden");

});



});



 





















Ya think that could be more simple. It works right?



Check it out, it does something much different then what I expected.



http://www.whatbird.com/wwwroot/3statebutton_2.html



So is hover not a good solution?



Mitch



-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Geary
Sent: Wednesday, July 25, 2007 10:10 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide





Rob, I think you left out the return statement that you meant to put in.
:-)



(Outstanding explanation, BTW!)



For clarity, it could be:



   jQuery.fn.toggleVis = function() {

  this.each(function() {

 if (this.style.visibility == 'hidden') {

this.style.visibility = 'visible';

 } else {

this.style.visibility = 'hidden';

 }

  });

  return this;

   };







[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mitchell Waite
Leave it to Michael to leave the most indelible mark. I now a see the subtle
issues with "this" In fact I have a whole a new take on jQuery since
listening to Michael about "this" and trying to get my tediously simple
little toggle to work. 

 

It actually started in Javascript and was a lot more code, so I appreciate
that it's so more streamlined. 

 

However the abstraction leaves me a bit uneasy. Given there is no simple way
to tell a DOM "this" from a jQ "this", I ended up doing this:

 

 

/* from Rob */

function toggleVis(element) { 

if (element.style.visibility == 'hidden') {  

element.style.visibility = 'visible'; 

} else { 

element.style.visibility = 'hidden'; 

} 

} 

 

Contrasting this with Michael G's code

 

   jQuery.fn.toggleVis = function() {

  return this.each( function( index, element ) {

 if (element.style.visibility == 'hidden') {

element.style.visibility = 'visible';

 } else {

element.style.visibility = 'hidden';

 }

  });

   };

 

I think Rob's makes more sense to a beginner. 

 

 called by this

 

 $("#toggle").click(function() { 

  var $cat = $('#cheshireCat');  

  if ($cat.length) { 

 toggleVis($cat[0]); 

   } 

  });

 

This was advice from Rob, using a JS function and calling it with from
jQuery and sending it a DOM. I leave this here for the newbie's on this
list, as I know this is self evident to most people here.  

 

Now to muddle things either further.

 

I decided that I might be able to use jQuery's 'hover' to deal with the
whole issue of flipping visibility and so I made this:

 

.hidden {display: none;}

 

.showPic {

   position:absolute;

   width:94px;

   height:31px;

   z-index:1;

}

 



 



$(document).ready(function(){

 

   $("#showPic").hover(function() {

  $("#hover, #normal").toggleClass("hidden");

}); 

 

});  

 

 



 









 





 

Ya think that could be more simple. It works right?

 

Check it out, it does something much different then what I expected.

 

http://www.whatbird.com/wwwroot/3statebutton_2.html

 

So is hover not a good solution?

 

Mitch

 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Geary
Sent: Wednesday, July 25, 2007 10:10 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

 

Rob, I think you left out the return statement that you meant to put in. :-)

 

(Outstanding explanation, BTW!)

 

For clarity, it could be:

 

   jQuery.fn.toggleVis = function() {

  this.each(function() {

 if (this.style.visibility == 'hidden') {

this.style.visibility = 'visible';

 } else {

this.style.visibility = 'hidden';

 }

  });

  return this;

   };

 

 



[jQuery] Populating Select Boxes

2007-07-25 Thread Mike Miller

Hi,

I am new to jquery and have a problem that I cannot explain.  I am
trying to populate a select box with values from a database.  The
select box works fine in FF, but nothing appears to happen in IE.
Below is my code.  Any help on what this is caused by would be
greatly
appreciated:


HTML file:




Testing AJAX and PHP


$(document).ready(function(){
$("#sector").load("ajax-test2.php?cmd=init");
}
);









PHP FILE:


(select a person)
\n";
while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
echo "$row[recordid]\n";
}
}


?>


Note again that this works fine in FF (meaning that the select box is
populated), but does not work in IE.


Mike



[jQuery] Re: Java Errors when using .Accordion and .innerfade - Please help :)

2007-07-25 Thread Ganeshji Marwaha

Why don't u try reversing the order of call... Call the accordion first and
the innerFade next.

-GTG

On 7/25/07, Aaron <[EMAIL PROTECTED]> wrote:



Anyone have ideas on this one?

I would greatly appreciate the help! :)

On Jul 25, 10:03 am, Aaron <[EMAIL PROTECTED]> wrote:
> ok so after looking in fire bug it says the error is in the
> jquery.accordian.js
>
> and is
>
> jQuery(":first-child", this)[0] has no properties
> Accordion(Object showSpeed=250 hideSpeed=250
> header=div.title)jquery.accordion (line 174)
> (no name)()Common.js (line 25)
> e()jquery.js (line 11)
> e()jquery.js (line 11)
> e([function(), function()], function(), undefined)jquery.js (line 11)
> e()jquery.js (line 11)
> [Break on this error] header: jQuery(':first-child', this)
> [0].tagName // take first childs tagName ...
>
> On Jul 25, 9:58 am, Aaron <[EMAIL PROTECTED]> wrote:
>
>
>
> > I can post the url but you have to change your host file since it is a
> > testing site currently until they go live.
>
> > the url ishttp://stage.itsyourworld.org/wac/Default.aspandthe ip to
> > put in your host file is 63.87.221.69 stage.itsyourworld.org
>
> > i will also take a look in firefox and see if i can see exactly where
> > the error is.
>
> > Thanks so much for the help! :)
>
> > On Jul 25, 9:43 am, Stephan Beal <[EMAIL PROTECTED]> wrote:
>
> > > On Jul 25, 4:37 pm, Aaron <[EMAIL PROTECTED]> wrote:
>
> > > > Can someone please help?
> > > ...
> > > > But this still is not working and giving me an error. If i use
just
> > > > one of them they work fine but when i try and use both of them i
get
> > > > this javascript error.
> > > > 0.tagname is null or not an object
>
> > > Can you post a URL to a page demonstrating this problem? The error
> > > happens in some code outside what you have shown use (in one of the
> > > included .js files) and we cannot know where that error happens. If
> > > you can post a page showing the problem, someone with Firebug
> > > installed can quickly localize it.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -




[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Mario Moura

Thanks Jonathan

Almost but still not working

$('.collapsible .collapsed').bind('click', function() {

$(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen');
});

I said too

I have many .collapsible .collapsed classes so I cant change all at the same
time. Ideas?

So when I use your idea my All "tree" open and if I click again all close.
Works fine in main root.

Can I set in $(this) to apply this JQuery only in the real clicked
"element"? I am trying some XPath Selectors. Could you help me?

Cheers ;)

Mario


2007/7/25, Jonathan Sharp <[EMAIL PROTECTED]>:


The issue lies in that you're trying to bind your click event to
.collapsibleopen at document ready time. The .collapsibleopen class won't be
available until the user clicks to have it added. I think below is more of
what you're after...

$('.collapsible .collapsed .collapsibleopen').bind('click', function() {

$(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen');
});

Cheers,
-js


On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote:
>
> Hi Folks
>
> I am trying switch between two class
>
> Is it possible?
>
>
> $(document).ready(function(){
>
>  $(".collapsible .collapsed").click(function(){
> $(this).removeClass().addClass("collapsibleopen");
>  });
>
>  $("collapsibleopen").click(function(){
> $(this).removeClass().addClass("collapsible collapsed");
>  });
>
>  });
>
> My first switch works but when I click in collapsibleopen (change from
> the previous click) didnt change.
>
> I have many .collapsible .collapsed classes so I cant change all at the
> same time. Ideas?
>
> Regards
>
> --
> Mário






--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000


[jQuery] [ANNOUNCE] jCarouselLite version 0.4.0

2007-07-25 Thread Ganeshji Marwaha

Hi list,

I have updated the jCarouselLite plugin to its next revision - 0.4.0
. The project page is at
http://www.gmarwaha.com/jquery/jcarousellite/index.php

This revision adds a few cool features(based on demand) and fixes a few
bugs. It looks pretty stable now. If it stays stable for sometime, i might
raise it to 1.0 status pretty soon.

1. Added support for mouse-wheel interaction. By adding "mouseWheel:true" to
your list of options, you can scroll your mouse-wheel and navigate the
carousel.
2. Added support for auto-scroll. You can specify a delay between 2
subsequent scrolls in the "auto" option, and your carousel will magically
keep scrolling
3. The mouseWheel, autoScroll and button based navigation are not mutually
exclusive. You can use all three with the same carousel if you want.
4. Added support
for scrolling more than one item at a time. Just add "scroll:
someNumber" here to scroll that many items per unit of navigation.
5. Fixed bugs that were both reported here on the list and sent to my
personal email. Thanks guys for all your feedback.
6. Added 3 more demos to the project page, improved the documentation and
installation sections. The changelog and known-issues sections are also
updated. So, you should get a pretty accurate picture of the project's
current status there.

The best part is, it is still approximately 1.9 KB light (compressed).

I would be glad to hear some feedback.

-GTG


[jQuery] Re: Plug-ins: Tabs and Cookies

2007-07-25 Thread [EMAIL PROTECTED]

 Doh!

Thanks Klaus -- YOU ROCK!

I applied your suggestion and it worked.

Thanks again for the awesome plug-ins.

By the way, I submitted a comment into your blog with suggestions for
tabs v.3.

Matthew

On Jul 25, 1:30 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi, having some small troubles with the tabs plug-in from Klaus Hartl
> > (http://www.stilbuero.de/jquery/tabs/).
>
> > I'm trying to implement his cookies plug-in (see code below) and can't
> > seem to get the tabs to change to the defined tab using the method
> > "Start With Custom Tab" [code example: $('#container-1).tabs(2);].
>
> > As you can see in the code below, I'm trying to start with a custom
> > tab defined by "$.cookie(TABS_COOKIE)||1".  This should look up the
> > cookie and set the value if any, if not, the default is 1.
>
> > The cookie plug-in is working because I can view the cookie through my
> > browser, any ideas?
>
> > --CODE--
>
> > // create variable for cookie
> > var TABS_COOKIE = 'tabs_cookie';
>
> > // create tabs, add effects, check for cookie and set to correct tab
> > $("#container-1").tabs($.cookie(TABS_COOKIE)||1,{
> >   onClick: function(clicked){
> > var lastTab = $
> > (clicked).parents("ul").find("li").index(clicked.parentNode) + 1;
> > $.cookie(TABS_COOKIE, lastTab);},
> >   fxSlide: true,
> >   fxFade:  true,
> >   fxSpeed: "normal"
> > });
>
> > --END CODE--
>
> I think the problem is that $.cookie returns a string, but tabs()
> requires a number for the initial tab. Try:
>
> $("#container-1").tabs(parseInt($.cookie(TABS_COOKIE)) || 1, {
>  ...
>
> });
>
> --Klaus



[jQuery] Re: alternate next() behavior

2007-07-25 Thread Josh Bush

I think I'll be doing a final 1.0 release of masked input.  Thanks for
keeping me on my toes.

I kind of need mine to be very flexible, so I came up with this:
http://digitalbush.com/files/jquery/findnext/jquery.findnext.js

All you do is "$('something').findNext(optional selector);"

It's totally just fresh off my head.  It recurses children of the
current object, then tries the siblings and their children, then it
walks up the parent chain trying to find something.  In my stupid test
scenario it appears to work.  I'd love for some feedback on the above
method.  I'm sure it could use some optimization and refactoring.


Here's my test HTML:






Here's my test JS:
alert($("#num1").findNext("input").attr("id"));
alert($("#num2").findNext().attr("id"));
alert($("#num3").findNext().attr("id"));

In FF2 and IE7 I get my expected values of:
num2
num3
num4


-Josh

On Jul 25, 3:15 pm, Eric C <[EMAIL PROTECTED]> wrote:
> Josh:
>
> I had a similar issue, in fact using your very own maskedInput
> plugin.  I wanted the :completed callback to tabOver to the next
> input, regardless of the location.  I posted the code that works for
> me on this 
> thread:http://groups.google.com/group/jquery-en/browse_thread/thread/d9f5267...
>
> Any chance of a release on maskedInput soon?
>
> On Jul 25, 3:02 pm, Josh Bush <[EMAIL PROTECTED]> wrote:
>
> > .next() grabs the very next sibling.  I need to be able to grab the
> > very next occurrence of an object if it's a sibling, cousin (parent's
> > next sibling's child), uncle/aunt(parent's next sibling), nephew/
> > niece(sibling's child), or whatever.  If memory serves, .next() used
> > to have this behavior even if it might not have been intended.  Does
> > anyone have a good way to execute this type of behavior?
>
> > I'm guessing you would need to walk all siblings and their children
> > recursively.  If that failed, you would need to find your parents
> > sibling and continue the process.
>
> > Thanks in advance for any feedback.
>
> > Josh



[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Jonathan Sharp

The issue lies in that you're trying to bind your click event to
.collapsibleopen at document ready time. The .collapsibleopen class won't be
available until the user clicks to have it added. I think below is more of
what you're after...

$('.collapsible .collapsed .collapsibleopen').bind('click', function() {

$(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen');
});

Cheers,
-js


On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote:


Hi Folks

I am trying switch between two class

Is it possible?


$(document).ready(function(){

 $(".collapsible .collapsed").click(function(){
$(this).removeClass().addClass("collapsibleopen");
 });

 $("collapsibleopen").click(function(){
$(this).removeClass().addClass("collapsible collapsed");
 });

 });

My first switch works but when I click in collapsibleopen (change from the
previous click) didnt change.

I have many .collapsible .collapsed classes so I cant change all at the
same time. Ideas?

Regards

--
Mário


[jQuery] Re: Callback after append?

2007-07-25 Thread juliandormon


I did not know that. That worked great!


Klaus Hartl wrote:
> 
> 
> juliandormon wrote:
>> 
>> I'm adding html into a div using append. I want to update my custom
>> scrollbar
>> plugin which is in a parent div after the append has completed loading to
>> accommodate the new height of the content in the child div. What's the
>> proper way of doing a callback after append for a different div?
>> 
>> I cannot simply chain this because it's a different div.
>> 
>> This is what I have but the callback paramater does not seem to work for
>> append - perhaps it's not a parameter at all?
>> 
>> 
>> 
>> 
>> $("#childDiv").append('mygreatHTML',function(){$("#parentDiv").updateScrollBar()})
>> 
>> Much appreciated!
> 
> You don't need a callback, such operations happen one after the other in 
>   JavaScript:
> 
> $("#childDiv").append('mygreatHTML');
> $("#parentDiv").updateScrollBar();
> 
> You could of course still make a chain:
> 
> $("#childDiv").append('mygreatHTML').parent().updateScrollBar();
> 
> That frees you from having to use another hardcoded id...
> 
> 
> 
> --Klaus
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Callback-after-append--tf4146489s15494.html#a11800185
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Ganeshji Marwaha

I am not sure what i am telling is right or not, but try

$(this).removeClass().addClass("collapsible").addClass("collapsed");

If you think this couldn't be the problem ignore this message.

-GTG

On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote:


yes, But still not working. Strange behavior. I guess or I need study
more. :)

$(document).ready(function(){

 $(".collapsible .collapsed").click(function(){
$(this).removeClass().addClass ("collapsibleopen");
 });

 $(".collapsibleopen").click(function(){
$(this).removeClass().addClass("collapsible collapsed");
 });

 });

thanks

Regards

Mario


2007/7/25, Eric C <[EMAIL PROTECTED]>:
>
>
> shouldn't your line:
> $("collapsibleopen").click(function(){
> be
> $(".collapsibleopen").click(function(){
>
> ?
> On Jul 25, 3:28 pm, "Mario Moura" < [EMAIL PROTECTED]> wrote:
> > Hi Folks
> >
> > I am trying switch between two class
> >
> > Is it possible?
> >
> > $(document).ready(function(){
> >
> >  $(".collapsible .collapsed").click(function(){
> > $(this).removeClass().addClass("collapsibleopen");
> >  });
> >
> >  $("collapsibleopen").click(function(){
> > $(this).removeClass().addClass("collapsible collapsed");
> >  });
> >
> >  });
> >
> > My first switch works but when I click in collapsibleopen (change from
> the
> > previous click) didnt change.
> >
> > I have many .collapsible .collapsed classes so I cant change all at
> the same
> > time. Ideas?
> >
> > Regards
> >
> > --
> > Mário
>
>


--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000


[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Mario Moura

yes, But still not working. Strange behavior. I guess or I need study more.
:)

$(document).ready(function(){

$(".collapsible .collapsed").click(function(){
   $(this).removeClass().addClass("collapsibleopen");
});

$(".collapsibleopen").click(function(){
   $(this).removeClass().addClass("collapsible collapsed");
});

});

thanks

Regards

Mario


2007/7/25, Eric C <[EMAIL PROTECTED]>:



shouldn't your line:
$("collapsibleopen").click(function(){
be
$(".collapsibleopen").click(function(){

?
On Jul 25, 3:28 pm, "Mario Moura" <[EMAIL PROTECTED]> wrote:
> Hi Folks
>
> I am trying switch between two class
>
> Is it possible?
>
> $(document).ready(function(){
>
>  $(".collapsible .collapsed").click(function(){
> $(this).removeClass().addClass("collapsibleopen");
>  });
>
>  $("collapsibleopen").click(function(){
> $(this).removeClass().addClass("collapsible collapsed");
>  });
>
>  });
>
> My first switch works but when I click in collapsibleopen (change from
the
> previous click) didnt change.
>
> I have many .collapsible .collapsed classes so I cant change all at the
same
> time. Ideas?
>
> Regards
>
> --
> Mário





--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000


[jQuery] Re: Get a range of elements (getting late, and losing my mind)

2007-07-25 Thread Ganeshji Marwaha

Something like this should work to get the index of the li relative to the
list. There could be a shorter way, but u get the idea...

var liIndex;
$("ul.nav-page li").each(function(i) {
  if($(this).is(".curr")) {
 liIndex = i;
 return;
  }
});

-GTG

On 7/25/07, agent2026 <[EMAIL PROTECTED]> wrote:



Hey everyone,

I'm working on some pagination.  Before I move on to my issue, the
best pagination plugin I've found is John's pager (http://jquery.com/
api/js/pager.js). But it doesn't seem that this is being developed
further, and the only other I've found (http://rikrikrik.com/jquery/
pager, listed on jquery.com) is really only suited to paginating large
amounts of text, and not lists. Is there anything else out there?

So far, John's pager is looking really good but for one problem - it
has no handling for situations with a high number of pages.  So, I'm
trying to break it up - first prev  2 3 4 5 6 ... 10 ... 20 next last
- sort of thing instead of  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 ... etc.

For this I figure I can use gt() and lt() as a start at least to trim
off the edges so to speak, but I can't figure out how to get the index
of the li with the current page (which has a class of 'cur') relative
to the list and not every element in the DOM.  If I could get that,
then I'm guessing I could hide anything greater/less than the current
index plus/minus 5 for example.

Alternatively, and probably easier, each link in the pagination has a
'rel' attribute numbered sequentially, but I can't seem to get
anything by .attr('rel');

Here's the mark up generated by John's pager (shortened for
simplicity):


« Prev
1
2
3
4
5
Next »



Any help greatly appreciated.

Thanks,
Adam




[jQuery] Re: Opacity in fadeTo, etc does not work in IE, am I crazy?

2007-07-25 Thread Brandon Aaron

Are you using jQuery 1.1.3.1?

--
Brandon Aaron

On 7/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



Hi,

I've posted about this before but no one has replied.  Is anyone
having issues in IE 6/7 with opacity? It doesn't seem to be using the
filter: to toggle opacity for me...

I find it bizarre that jQuery would not have covered this.  Maybe it
has something to do with running IE through parallels?

Thanks!




[jQuery] Opacity in fadeTo, etc does not work in IE, am I crazy?

2007-07-25 Thread [EMAIL PROTECTED]

Hi,

I've posted about this before but no one has replied.  Is anyone
having issues in IE 6/7 with opacity? It doesn't seem to be using the
filter: to toggle opacity for me...

I find it bizarre that jQuery would not have covered this.  Maybe it
has something to do with running IE through parallels?

Thanks!



[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Eric C

shouldn't your line:
 $("collapsibleopen").click(function(){
be
 $(".collapsibleopen").click(function(){

?
On Jul 25, 3:28 pm, "Mario Moura" <[EMAIL PROTECTED]> wrote:
> Hi Folks
>
> I am trying switch between two class
>
> Is it possible?
>
> $(document).ready(function(){
>
>  $(".collapsible .collapsed").click(function(){
> $(this).removeClass().addClass("collapsibleopen");
>  });
>
>  $("collapsibleopen").click(function(){
> $(this).removeClass().addClass("collapsible collapsed");
>  });
>
>  });
>
> My first switch works but when I click in collapsibleopen (change from the
> previous click) didnt change.
>
> I have many .collapsible .collapsed classes so I cant change all at the same
> time. Ideas?
>
> Regards
>
> --
> Mário



[jQuery] Get a range of elements (getting late, and losing my mind)

2007-07-25 Thread agent2026

Hey everyone,

I'm working on some pagination.  Before I move on to my issue, the
best pagination plugin I've found is John's pager (http://jquery.com/
api/js/pager.js). But it doesn't seem that this is being developed
further, and the only other I've found (http://rikrikrik.com/jquery/
pager, listed on jquery.com) is really only suited to paginating large
amounts of text, and not lists. Is there anything else out there?

So far, John's pager is looking really good but for one problem - it
has no handling for situations with a high number of pages.  So, I'm
trying to break it up - first prev  2 3 4 5 6 ... 10 ... 20 next last
- sort of thing instead of  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 ... etc.

For this I figure I can use gt() and lt() as a start at least to trim
off the edges so to speak, but I can't figure out how to get the index
of the li with the current page (which has a class of 'cur') relative
to the list and not every element in the DOM.  If I could get that,
then I'm guessing I could hide anything greater/less than the current
index plus/minus 5 for example.

Alternatively, and probably easier, each link in the pagination has a
'rel' attribute numbered sequentially, but I can't seem to get
anything by .attr('rel');

Here's the mark up generated by John's pager (shortened for
simplicity):


« Prev
1
2
3
4
5
Next »



Any help greatly appreciated.

Thanks,
Adam



[jQuery] Re: safari failing to remove()

2007-07-25 Thread RwL

> As you're adding the span to the link itself, maybe both click events
> somehow interfere in Safari... what about:

I think you're right on the money... I haven't tried your code yet,
but mine was fixed instantly by using insertAfter() instead of
append(), and I think that will be fine for my purposes.



[jQuery] Form Client and server side validaion probleme

2007-07-25 Thread Samad

Hello,

I'm trying to fix a validation form probleme but I don't have any
idea.

This is the probleme :

I have a forum with inputs, for the validation, I have some client
side controls and server ones with an ajax call.
this is the code :

--
$("#Register").submit(function() {

$(".ErrorDiv").hide();
$(".SuccessDiv").hide();

var msg_error = 0;

var valid_email = /^\w+([\.-]?\w+)[EMAIL 
PROTECTED]([\.-]?\w+)*(\.\w{2,3})
+$/;
var valid_text = /^\w+$/;



var username = $("#Username").val();
var email = $("#Email").val();
var pwd = $("#Password").val();
var pwd_conf = $("#PasswordConf").val();


if ( !username.match(valid_text)  || username == "" ) {

msg_error = 1;
$("#Username_Error").show();

} else {

$.ajax({
type: "POST",
url: "inc/user_reg.hand.php",
data: "action=check_username&username="+username,
dataType: "html",
success: function(msg){

if (msg == "KO") {
msg_error = 1;
$("#UsernameUsed_Error").show();

}

}
});

}

if ( !email.match(valid_email) || email == "" ) {

msg_error = 1;
$("#Email_Error").show();

} else {

$.ajax({
type: "POST",
url: "inc/user_reg.hand.php",
data: "action=check_email&email="+email,
dataType: "html",
success: function(msgmail){

if (msgmail == "KO") {
msg_error = 1;
$("#EmailUsed_Error").show();

}

}
});

}

if ( !pwd.match(valid_text)  || pwd == "" ) {
msg_error = 1;
$("#Password_Error").show();
}

if ( pwd != pwd_conf ) {
msg_error = 1;
$("#PasswordConf_Error").show();
}


if( msg_error == 0 ) {

$.ajax({
type: "POST",
url: "inc/user_reg.hand.php",
data: "action=register&username="+username
+"&email="+email+"&password="+pwd,
dataType: "html",
beforeSend: function(msgregister){

},
success: function(msgregister){

$("#Register_Success").show();
bindStyle();

}
});

}

return false; // cancel conventional submit

});


--

The thing is : when I try the ajax call the first time with the
'Username' and after a 'KO' response, the variable msg_error is still
on '0' and not '1' even if the msg received after the call is 'KO'
and the "#UsernameUsed_Error" is showed.

Can anyone help ?? :)



[jQuery] Re: jQuery AJAX w/ ASP.NET

2007-07-25 Thread Armand Datema


mm

well i know one way that might interfere with your script altho I
cannot see it in this code.

an aspx page mus have one form standard



if you have an element that has runat="server" attribute you cannot
call it directly as #loginForm  because asp.net rewrites the id to
something different  just doa view source on your aspx page and you
will see the renamed form cleintid

Armand



On 7/25/07, mrandolph <[EMAIL PROTECTED]> wrote:


For the life of me, I cannot get jQuery working w/ ASP.NET.  My front-
end seems to call the .NET script, but once the script is processed,
it's forwarding the browser to the ASPX result page rather than just
returning the values.  I've tried using $.ajax, $.post, the form
plugin, just about every way a noob could think of with no results,
posted is all of the code involved, maybe someone can make sense of
this?

HTML/JS code:


http://www.w3.org/1999/xhtml";>


Client / login





$(document).ready(function()
{
var options = {beforeSubmit:validate,
   success:onData,
   dataType:"json"};

$("#loginForm").ajaxForm(options);
});
});

function validate(formData, jqForm, options)
{
for (var i = 0; i < formData.length; i++)
{
if (!formData[i].value)
{
alert("Please enter a value for both Username and 
Password");
return false;
}
}

return true;
}

function onData(responseText, statusText)
{
alert("status: " + statusText + "\n\nresponseText: \n" +
responseText + "\n\nThe output div should have already been updated
with the responseText.");
}






Client

Streaming Media Manager / 
login



username
  
  password
  
   Remember me next time?
   
  
  » forgot your
password?







.NET code:

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using JSONSharp;

namespace StreamingMediaManager
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
JSONReflector jr = null;

using (SqlConnection sqlConn = new
SqlConnection(Application["SqlConnectionString"].ToString()))
{
sqlConn.Open();
SqlCommand sqlCmd = sqlConn.CreateCommand();
sqlCmd.Connection = sqlConn;

try
{
SqlParameter paramUserId = new SqlParameter();
SqlParameter paramClientName = new SqlParameter();
SqlParameter paramUserName = new SqlParameter();
SqlParameter paramPassword = new SqlParameter();

paramUserId.Direction = ParameterDirection.Output;
paramUserId.ParameterName = "@UserID";
paramUserId.SqlDbType = SqlDbType.Int;

paramClientName.Direction =
ParameterDirection.Output;
paramClientName.ParameterName = "@ClientName";
paramClientName.SqlDbType = SqlDbType.VarChar;
paramClientName.Size = 100;

paramUserName.Direction =
ParameterDirection.Input;
paramUserName.ParameterName = "@UserName";
paramUserName.SqlDbType = SqlDbType.VarChar;
paramUserName.Size = 50;
paramUserName.Value = Request["username"];

paramPassword.Direction =
ParameterDirection.Input;
paramPassword.ParameterName = "@Password";
paramPassword.SqlDbType = SqlDbType.VarChar;
paramPassword.Size = 30;
paramPassword.Value = Request["password"];

sqlCmd.Parameters.Add(paramUserId);
sqlCmd.Parameters.Add(paramClientName);
sqlCmd.Parameters.Add(paramUserName);
sqlCmd.Parameters.Add(paramPassword);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "spProcessLogin";
SqlDataReader sdr = sqlCmd.ExecuteReader();
UserInfo ui = new UserInfo();

ui.ID = (int)paramUserId.Value;
ui.UserName = paramUserName.Valu

[jQuery] Re: safari failing to remove()

2007-07-25 Thread Klaus Hartl


RwL wrote:

Can't figure out for the live of me why remove() is working on this
function in every browser but Safari:

http://www.lifford.org/exp/tmr.html

to summarize what's going on, this is my only function:

$(document).ready(function() {
$('a').not($("#nav [EMAIL PROTECTED]"))
.click(function() {
$('All 
links in this demo are
disabled except those under "Nav". close').appendTo(this).click(function() { $(this).remove(); });
return false;
});
});


So,
1) links (except in #nav) are selected
2) on click some HTML is appended to the link, and then given its own
onclick event to remove itself from the DOM

Seems to work as intended everywhere but Safari, version 2.0.4
(419.3), where the remove() fails. I have Safari's JS Console turned
on but not seeing anything there.

I've tried using a number of different selectors with the remove(),
but nothing I've tried makes Safari work.


As you're adding the span to the link itself, maybe both click events 
somehow interfere in Safari... what about:


$('a').not($("#nav [EMAIL PROTECTED]")).click(function(e) {
if (e.target.nodeName.toLowerCase() != 'span') {
$('All links in this demo are 
disabled except those under "Nav". close')

.appendTo(this)
.click(function() { $(this).remove(); });
}
return false;
});


Just guessing...


--Klaus


[jQuery] Re: alternate next() behavior

2007-07-25 Thread Eric C

Josh:

I had a similar issue, in fact using your very own maskedInput
plugin.  I wanted the :completed callback to tabOver to the next
input, regardless of the location.  I posted the code that works for
me on this thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/d9f526718f3feaa0/d5d137d73d79d1df

Any chance of a release on maskedInput soon?


On Jul 25, 3:02 pm, Josh Bush <[EMAIL PROTECTED]> wrote:
> .next() grabs the very next sibling.  I need to be able to grab the
> very next occurrence of an object if it's a sibling, cousin (parent's
> next sibling's child), uncle/aunt(parent's next sibling), nephew/
> niece(sibling's child), or whatever.  If memory serves, .next() used
> to have this behavior even if it might not have been intended.  Does
> anyone have a good way to execute this type of behavior?
>
> I'm guessing you would need to walk all siblings and their children
> recursively.  If that failed, you would need to find your parents
> sibling and continue the process.
>
> Thanks in advance for any feedback.
>
> Josh



[jQuery] jQuery AJAX w/ ASP.NET

2007-07-25 Thread mrandolph

For the life of me, I cannot get jQuery working w/ ASP.NET.  My front-
end seems to call the .NET script, but once the script is processed,
it's forwarding the browser to the ASPX result page rather than just
returning the values.  I've tried using $.ajax, $.post, the form
plugin, just about every way a noob could think of with no results,
posted is all of the code involved, maybe someone can make sense of
this?

HTML/JS code:


http://www.w3.org/1999/xhtml";>


Client / login





$(document).ready(function()
{
var options = {beforeSubmit:validate,
   success:onData,
   dataType:"json"};

$("#loginForm").ajaxForm(options);
});
});

function validate(formData, jqForm, options)
{
for (var i = 0; i < formData.length; i++)
{
if (!formData[i].value)
{
alert("Please enter a value for both Username 
and Password");
return false;
}
}

return true;
}

function onData(responseText, statusText)
{
alert("status: " + statusText + "\n\nresponseText: \n" +
responseText + "\n\nThe output div should have already been updated
with the responseText.");
}






Client

Streaming Media Manager / 
login



username
  
  password
  
   Remember me next time?
   
  
  » forgot your
password?







.NET code:

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using JSONSharp;

namespace StreamingMediaManager
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
JSONReflector jr = null;

using (SqlConnection sqlConn = new
SqlConnection(Application["SqlConnectionString"].ToString()))
{
sqlConn.Open();
SqlCommand sqlCmd = sqlConn.CreateCommand();
sqlCmd.Connection = sqlConn;

try
{
SqlParameter paramUserId = new SqlParameter();
SqlParameter paramClientName = new SqlParameter();
SqlParameter paramUserName = new SqlParameter();
SqlParameter paramPassword = new SqlParameter();

paramUserId.Direction = ParameterDirection.Output;
paramUserId.ParameterName = "@UserID";
paramUserId.SqlDbType = SqlDbType.Int;

paramClientName.Direction =
ParameterDirection.Output;
paramClientName.ParameterName = "@ClientName";
paramClientName.SqlDbType = SqlDbType.VarChar;
paramClientName.Size = 100;

paramUserName.Direction =
ParameterDirection.Input;
paramUserName.ParameterName = "@UserName";
paramUserName.SqlDbType = SqlDbType.VarChar;
paramUserName.Size = 50;
paramUserName.Value = Request["username"];

paramPassword.Direction =
ParameterDirection.Input;
paramPassword.ParameterName = "@Password";
paramPassword.SqlDbType = SqlDbType.VarChar;
paramPassword.Size = 30;
paramPassword.Value = Request["password"];

sqlCmd.Parameters.Add(paramUserId);
sqlCmd.Parameters.Add(paramClientName);
sqlCmd.Parameters.Add(paramUserName);
sqlCmd.Parameters.Add(paramPassword);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "spProcessLogin";
SqlDataReader sdr = sqlCmd.ExecuteReader();
UserInfo ui = new UserInfo();

ui.ID = (int)paramUserId.Value;
ui.UserName = paramUserName.Value.ToString();
ui.Password = paramPassword.Value.ToString();
ui.ClientName = paramClientName.Value.ToString();

Session.Add("UserInfo", ui);
jr = new JSONReflector(ui);
}
catch (SqlException sqlex)
{
ErrorObject eo = new ErrorObject();

eo.Message = sqlex.Message;

  

[jQuery] safari failing to remove()

2007-07-25 Thread RwL

Can't figure out for the live of me why remove() is working on this
function in every browser but Safari:

http://www.lifford.org/exp/tmr.html

to summarize what's going on, this is my only function:

$(document).ready(function() {
$('a').not($("#nav [EMAIL PROTECTED]"))
.click(function() {
$('All 
links in this demo are
disabled except those under "Nav". close').appendTo(this).click(function() { $(this).remove(); });
return false;
});
});


So,
1) links (except in #nav) are selected
2) on click some HTML is appended to the link, and then given its own
onclick event to remove itself from the DOM

Seems to work as intended everywhere but Safari, version 2.0.4
(419.3), where the remove() fails. I have Safari's JS Console turned
on but not seeing anything there.

I've tried using a number of different selectors with the remove(),
but nothing I've tried makes Safari work.



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Michael Geary

> From: Michael Geary
> 
> The use of "this" inside an "each" loop is one of the two 
> major design errors in jQuery (the other being the event 
> system, which I'll get to another day).

Just to avoid any possible misunderstanding, I think everyone knows I
consider jQuery to be a brilliant piece of work. Even so, it would be
surprising if there were *no* design flaws. :-) (And "major design errors"
is probably overstating it quite a bit!)

The event system is actually a more subtle and interesting problem. jQuery's
event system is derived from Dean Edwards' entry in the famous addEvent()
recoding contest [1] that took place in September 2005. The contest
specified an addEvent interface that looked good on paper but added
complexity to the implementation.

A small change to the specification allows for a simpler event system, like
the one I coded recently for my Zvents event calendar widgets.
Unfortunately, the original contest specification is gone from quirksmode,
org, and the Wayback Machine at archive.org is broken right now too. Once I
get a hold of the original specs I'll write up an article about this. It's a
fairly interesting design exercise (of course I would say that!), even if it
is too late for it to do much good for existing libraries that based their
event systems on the contest entries.

-Mike

[1] http://www.quirksmode.org/blog/archives/2005/09/addevent_recodi.html



[jQuery] Re: Possible to retrieve image data via AJAX for display?

2007-07-25 Thread Christof Donat

Hi,

> I believe the ctx variable should be:
>
> var ctx = $('')[0].getContext("2d");

I was expecting that a canvas tag exists on the page. If it doesn't it should 
better be something like this:

var ctx = $('').appendto('body')[0].getContext("2d");

Christof




[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Brandon Aaron

I get this a few times as well. Just gotta restart Firefox.

--
Brandon Aaron

On 7/25/07, RwL <[EMAIL PROTECTED]> wrote:



> What I'm interested in is if the recursion error still occurs with my
> final suggestion?
> --Klaus

Ah, sorry Klaus -- it doesn't, but take that with a grain of salt,
because I can't reproduce the error anymore with my orignal syntax.
I'm writing this off as Firebug behaving badly.




[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread RwL

> What I'm interested in is if the recursion error still occurs with my
> final suggestion?
> --Klaus

Ah, sorry Klaus -- it doesn't, but take that with a grain of salt,
because I can't reproduce the error anymore with my orignal syntax.
I'm writing this off as Firebug behaving badly.



[jQuery] Re: convert an event object to a jQuery event object?

2007-07-25 Thread Brandon Aaron

Just pass the event object through this private jQuery method:

event = $.event.fix(event);

Although, why not just use jQuery to bind the events in the first place?

--
Brandon Aaron


On 7/25/07, Jeff L <[EMAIL PROTECTED]> wrote:


Hi,

Is there a way to take a normal event object and convert it to a jQuery
event object so everything gets normalized?  Or can you only use the jquery
event stuff when you use the jQuery events themselves?


Hope this makes sense.


Thanks,

Jeff



[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Klaus Hartl


RwL wrote:

Thanks John; thanks Klaus. Responding to Klaus:


That said, $("a").not( $("#nav a") ) is not supposed to work if I understood 
that correctly.


Having reread the spec, I agree with you, but oddly $("a").not( $
("#nav a") ) DID work as I expected it to. No matter. Your final
suggestion works too.

And the Too Much Recursion error is largely irrelevant because an
alert isn't what I really want to do here anyway. I'll be posting a
new problem shortly :^p


What I'm interested in is if the recursion error still occurs with my 
final suggestion?



--Klaus


[jQuery] Re: Plug-ins: Tabs and Cookies

2007-07-25 Thread Klaus Hartl


[EMAIL PROTECTED] wrote:

Hi, having some small troubles with the tabs plug-in from Klaus Hartl
(http://www.stilbuero.de/jquery/tabs/).

I'm trying to implement his cookies plug-in (see code below) and can't
seem to get the tabs to change to the defined tab using the method
"Start With Custom Tab" [code example: $('#container-1).tabs(2);].

As you can see in the code below, I'm trying to start with a custom
tab defined by "$.cookie(TABS_COOKIE)||1".  This should look up the
cookie and set the value if any, if not, the default is 1.

The cookie plug-in is working because I can view the cookie through my
browser, any ideas?

--CODE--

// create variable for cookie
var TABS_COOKIE = 'tabs_cookie';

// create tabs, add effects, check for cookie and set to correct tab
$("#container-1").tabs($.cookie(TABS_COOKIE)||1,{
  onClick: function(clicked){
var lastTab = $
(clicked).parents("ul").find("li").index(clicked.parentNode) + 1;
$.cookie(TABS_COOKIE, lastTab);},
  fxSlide: true,
  fxFade:  true,
  fxSpeed: "normal"
});

--END CODE--


I think the problem is that $.cookie returns a string, but tabs() 
requires a number for the initial tab. Try:


$("#container-1").tabs(parseInt($.cookie(TABS_COOKIE)) || 1, {
...
});



--Klaus




[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread RwL

Thanks John; thanks Klaus. Responding to Klaus:

>>That said, $("a").not( $("#nav a") ) is not supposed to work if I understood 
>>that correctly.

Having reread the spec, I agree with you, but oddly $("a").not( $
("#nav a") ) DID work as I expected it to. No matter. Your final
suggestion works too.

And the Too Much Recursion error is largely irrelevant because an
alert isn't what I really want to do here anyway. I'll be posting a
new problem shortly :^p



[jQuery] switch between two class - Basic Issue

2007-07-25 Thread Mario Moura

Hi Folks

I am trying switch between two class

Is it possible?


$(document).ready(function(){

$(".collapsible .collapsed").click(function(){
   $(this).removeClass().addClass("collapsibleopen");
});

$("collapsibleopen").click(function(){
   $(this).removeClass().addClass("collapsible collapsed");
});

});

My first switch works but when I click in collapsibleopen (change from the
previous click) didnt change.

I have many .collapsible .collapsed classes so I cant change all at the same
time. Ideas?

Regards

--
Mário


[jQuery] Re: Callback after append?

2007-07-25 Thread Matt Stith

Thats right, the only things that need a callback are ajax and animations
(unless im missing something)

On 7/25/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:



juliandormon wrote:
>
> I'm adding html into a div using append. I want to update my custom
scrollbar
> plugin which is in a parent div after the append has completed loading
to
> accommodate the new height of the content in the child div. What's the
> proper way of doing a callback after append for a different div?
>
> I cannot simply chain this because it's a different div.
>
> This is what I have but the callback paramater does not seem to work for
> append - perhaps it's not a parameter at all?
> 
> 
> 
>
>
$("#childDiv").append('mygreatHTML',function(){$("#parentDiv").updateScrollBar()})
>
> Much appreciated!

You don't need a callback, such operations happen one after the other in
  JavaScript:

$("#childDiv").append('mygreatHTML');
$("#parentDiv").updateScrollBar();

You could of course still make a chain:

$("#childDiv").append('mygreatHTML').parent().updateScrollBar();

That frees you from having to use another hardcoded id...



--Klaus



[jQuery] Re: Callback after append?

2007-07-25 Thread Klaus Hartl


juliandormon wrote:


I'm adding html into a div using append. I want to update my custom scrollbar
plugin which is in a parent div after the append has completed loading to
accommodate the new height of the content in the child div. What's the
proper way of doing a callback after append for a different div?

I cannot simply chain this because it's a different div.

This is what I have but the callback paramater does not seem to work for
append - perhaps it's not a parameter at all?




$("#childDiv").append('mygreatHTML',function(){$("#parentDiv").updateScrollBar()})

Much appreciated!


You don't need a callback, such operations happen one after the other in 
 JavaScript:


$("#childDiv").append('mygreatHTML');
$("#parentDiv").updateScrollBar();

You could of course still make a chain:

$("#childDiv").append('mygreatHTML').parent().updateScrollBar();

That frees you from having to use another hardcoded id...



--Klaus


[jQuery] Plug-ins: Tabs and Cookies

2007-07-25 Thread [EMAIL PROTECTED]

Hi, having some small troubles with the tabs plug-in from Klaus Hartl
(http://www.stilbuero.de/jquery/tabs/).

I'm trying to implement his cookies plug-in (see code below) and can't
seem to get the tabs to change to the defined tab using the method
"Start With Custom Tab" [code example: $('#container-1).tabs(2);].

As you can see in the code below, I'm trying to start with a custom
tab defined by "$.cookie(TABS_COOKIE)||1".  This should look up the
cookie and set the value if any, if not, the default is 1.

The cookie plug-in is working because I can view the cookie through my
browser, any ideas?

--CODE--

// create variable for cookie
var TABS_COOKIE = 'tabs_cookie';

// create tabs, add effects, check for cookie and set to correct tab
$("#container-1").tabs($.cookie(TABS_COOKIE)||1,{
  onClick: function(clicked){
var lastTab = $
(clicked).parents("ul").find("li").index(clicked.parentNode) + 1;
$.cookie(TABS_COOKIE, lastTab);},
  fxSlide: true,
  fxFade:  true,
  fxSpeed: "normal"
});

--END CODE--



[jQuery] Re: Callback after append?

2007-07-25 Thread Mike Alsup


Julian, have you tried this?

$("#childDiv").append('mygreatHTML').parent().updateScrollBar();



$("#childDiv").append('mygreatHTML',function(){$("#parentDiv").updateScrollBar()})


[jQuery] convert an event object to a jQuery event object?

2007-07-25 Thread Jeff L

Hi,

Is there a way to take a normal event object and convert it to a jQuery
event object so everything gets normalized?  Or can you only use the jquery
event stuff when you use the jQuery events themselves?


Hope this makes sense.


Thanks,

Jeff


[jQuery] Re: Formatting External Links

2007-07-25 Thread Karl Swedberg


On Jul 25, 2007, at 10:04 AM, Joel Birch wrote:


Maybe this addresses this issue?

$('[EMAIL PROTECTED]://]').not('[EMAIL PROTECTED]')


that should do it. since the "http" would always come at the  
beginning of the href, it might be a little cleaner to use "^" for  
the first selector instead. Also, I'd keep it to "http" without the  
"://" just in case someone is using "https":


$('[EMAIL PROTECTED]').not('[EMAIL PROTECTED]')


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com






[jQuery] Callback after append?

2007-07-25 Thread juliandormon


I'm adding html into a div using append. I want to update my custom scrollbar
plugin which is in a parent div after the append has completed loading to
accommodate the new height of the content in the child div. What's the
proper way of doing a callback after append for a different div?

I cannot simply chain this because it's a different div.

This is what I have but the callback paramater does not seem to work for
append - perhaps it's not a parameter at all?




$("#childDiv").append('mygreatHTML',function(){$("#parentDiv").updateScrollBar()})

Much appreciated!
-- 
View this message in context: 
http://www.nabble.com/Callback-after-append--tf4146489s15494.html#a11796056
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: ANNOUNCEMENT: jQuery resetDefaultValue plugin

2007-07-25 Thread Klaus Hartl


Leandro Vieira Pinho wrote:

Hi,

It´s a simple plugin, that let you clear and reset the value of input
elements.

Example of usage:

$(function() {
 $('input').resetDefaultValue(); // for all input elements
 $('input.className').resetDefaultValue(); // for some elements
 $('#q').resetDefaultValue(); // for a especific element
});

The plugin code:

/**
 * jQuery resetDefaultValue plugin
 * @version 0.9
 * @author Leandro Vieira Pinho <[EMAIL PROTECTED]>
 * How to use
 * $(function() {
 *  $('input').resetDefaultValue(); // for all input elements
 *  $('input.className').resetDefaultValue(); // for some elements
 *  $('#q').resetDefaultValue(); // for a especific element
 * });
 * ChangeLog
 * 0.1 - First relase
 * 0.2 - Filter input elements with type igual text, just it.
 * 0.9 - Rewrite all the plugin code. Thanks to Klaus Hartl [
http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd021062331
]
 */
jQuery.fn.resetDefaultValue = function() {
function _clearDefaultValue() {
var _$ = $(this);
if ( _$.val() == this.defaultValue ) { _$.val(''); }
};
function _resetDefaultValue() {
var _$ = $(this);
if ( _$.val() == '' ) { _$.val(this.defaultValue); }
};
return
this.filter('[EMAIL 
PROTECTED]').click(_clearDefaultValue).focus(_clearDefaultValue).blur(_resetDefaultValue);
}

The resetDefaultValue plugin has borned here:
http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd021062331



Leandro,

another thought: I think it is reasonable to filter the result set for 
the type, but you're also returning the filtered set, which kind of 
breaks chainability and might give unexpected results, as some elements 
are missing after your plugin's method in the chain.


That said, here's what I propose:

jQuery.fn.resetDefaultValue = function() {
function _clearDefaultValue() {
var _$ = $(this);
if ( _$.val() == this.defaultValue ) { _$.val(''); }
};
function _resetDefaultValue() {
var _$ = $(this);
if ( _$.val() == '' ) { _$.val(this.defaultValue); }
};

this
.filter('[EMAIL PROTECTED]')
.click(_clearDefaultValue)
.focus(_clearDefaultValue)
.blur(_resetDefaultValue);
return this;
}

Ah, or just add an end() at the end of the chain, that's shorter:

return this
.filter('[EMAIL PROTECTED]')
.click(_clearDefaultValue)
.focus(_clearDefaultValue)
.blur(_resetDefaultValue)
.end();


Cheers, Klaus





[jQuery] alternate next() behavior

2007-07-25 Thread Josh Bush

.next() grabs the very next sibling.  I need to be able to grab the
very next occurrence of an object if it's a sibling, cousin (parent's
next sibling's child), uncle/aunt(parent's next sibling), nephew/
niece(sibling's child), or whatever.  If memory serves, .next() used
to have this behavior even if it might not have been intended.  Does
anyone have a good way to execute this type of behavior?

I'm guessing you would need to walk all siblings and their children
recursively.  If that failed, you would need to find your parents
sibling and continue the process.

Thanks in advance for any feedback.

Josh



[jQuery] ANNOUNCEMENT: jQuery resetDefaultValue plugin

2007-07-25 Thread Leandro Vieira Pinho

Hi,

It´s a simple plugin, that let you clear and reset the value of input
elements.

Example of usage:

$(function() {
 $('input').resetDefaultValue(); // for all input elements
 $('input.className').resetDefaultValue(); // for some elements
 $('#q').resetDefaultValue(); // for a especific element
});

The plugin code:

/**
 * jQuery resetDefaultValue plugin
 * @version 0.9
 * @author Leandro Vieira Pinho <[EMAIL PROTECTED]>
 * How to use
 * $(function() {
 *  $('input').resetDefaultValue(); // for all input elements
 *  $('input.className').resetDefaultValue(); // for some elements
 *  $('#q').resetDefaultValue(); // for a especific element
 * });
 * ChangeLog
 * 0.1 - First relase
 * 0.2 - Filter input elements with type igual text, just it.
 * 0.9 - Rewrite all the plugin code. Thanks to Klaus Hartl [
http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd021062331
]
 */
jQuery.fn.resetDefaultValue = function() {
function _clearDefaultValue() {
var _$ = $(this);
if ( _$.val() == this.defaultValue ) { _$.val(''); }
};
function _resetDefaultValue() {
var _$ = $(this);
if ( _$.val() == '' ) { _$.val(this.defaultValue); }
};
return
this.filter('[EMAIL 
PROTECTED]').click(_clearDefaultValue).focus(_clearDefaultValue).blur(_resetDefaultValue);
}

The resetDefaultValue plugin has borned here:
http://groups.google.com/group/jquery-en/browse_thread/thread/5ca50fd021062331



[jQuery] Allowing Interface Draggables to scroll the document

2007-07-25 Thread MK

Hi,

I've noticed that the default behavior for Interface draggables is to
not allow scrolling the document while you're dragging. However, for a
certain project I need to be able to scroll the document while
dragging for users with small browser viewports. What is the easiest
way around this? I tried using an array for the 'containment'
property, setting h to document.body.clientHeight, but this didn't
seem to work. Any ideas?



[jQuery] Allowing Interface Draggables to scroll the document

2007-07-25 Thread MK

Hi,

I've noticed that the default behavior for Interface draggables is to
not allow scrolling the document while you're dragging. However, for a
certain project I need to be able to scroll the document while
dragging for users with small browser viewports. What is the easiest
way around this? I tried using an array for the 'containment'
property, setting h to document.body.clientHeight, but this didn't
seem to work. Any ideas?



[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Klaus Hartl


Klaus Hartl wrote:
Let's not add classes only for that purpose. Maybe you can also try to 
workaround this limitation by selecting not by type but href attribute 
which is only allowed for links:


$("a").not("#nav [EMAIL PROTECTED]")



I'm sorry, that should have read:

$("a").not( $("#nav [EMAIL PROTECTED]") );


--Klaus


[jQuery] Re: Ajax: (Didn't have time to go over posted messages)

2007-07-25 Thread Klaus Hartl


andreas wrote:

Are custom headers (x-*) supported in the current version of Jquery ?

If not any quick workarounds ?

Didn't have time to go over the posts in the group and i would
appreciate answers/tips cause i need to deploy an app. based heavily
on async calls and custom headers will be required in many occasions.


thank you.



Well, if you don't have time to go over the posts, you should have a 
quick look at the docs for $.ajax instead. In the options section you'll 
find a beforeSend callback:


"beforeSend (Function) - A pre-callback to modify the XMLHttpRequest 
object before it is sent. Use this to set custom headers etc. The 
XMLHttpRequest is passed as the only argument."


http://docs.jquery.com/Ajax#Options

=>

$.ajax({
...
beforeSend: function(xhr) {
xhr.setRequestHeader('foo', 'bar');
}
});


I don't remember the correct syntax for setting the request header for 
an instance of an XmlHttpRequest object, so setRequestHeader maybe wrong.


HTH

--Klaus





[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Rob Desbois

Michael,


Rob, I think you left out the return statement that you meant to put in.

:-)
Whoops, thanks!


(Outstanding explanation, BTW!)

And thanks again :-) took a while to put it into rambling words.

Is there a decent article somewhere on docs.jquery.com or someone's blog
which explains what 'this' is and when?
It's such a common confusion that it really needs an obvious, short
description somewhere.

--rob


On 7/25/07, Mike Alsup <[EMAIL PROTECTED]> wrote:



:-)  Mike, I just reread your email and see that you pointed this out
already!   Sorry!

Mike

On 7/25/07, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > It would have been far better if "each" passed the DOM element as
> > an argument to the inner function, instead of using "this":
>
> It does pass the element, so if you prefer you could write code like:
>
> $('.stuff').each(function(index, element) {
> element.style.visibility = 'hidden';
> });





--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.


[jQuery] Re: Noob Question - .add() not working in IE?

2007-07-25 Thread John Resig


This is going to be an issue:
.attr("style") == "display: none;"

Up until just the other day, that wasn't working in IE (it's fixed
now, and it will be in jQuery 1.1.4). In the meantime I recommend that
you do:

.is(":hidden")

or:

.css("display") == "none"

--John

On 7/24/07, webrocker <[EMAIL PROTECTED]> wrote:


Hello group,

I try to dynamically add some tags and content to an existing element
(basically a toggle-link, that's only to be seen if JS is active and
that slideToggles a div). Somehow my code doesn't work in IE, although
it works fine in other browsers like Firefox or Safari:

+++

JQuery:

$(document).ready(function(){
   // hide div on pageready:
   if( $("div.reduction-wrap") ){
   $("div.reduction-wrap").hide();
   // add toggle link with icon to headline
   with( $("#toggle-link") ){
children('img').append('');
append(' show');
html( ''+$("#toggle-
link").html()+'');
   }
   // click on link toggles hidden div:
$("#reduction-toggle").click( function() {
$("div.reduction-wrap").slideToggle("normal",
function(){
if( $("div.reduction-wrap").attr("style") == 
"display: none;") {

$("#reduction-toggle").children("span").html("show");

$("#toggle-icon").attr({src:"images/pfeil-blau-r.gif", id:
"toggle-icon", alt: ""});
} else {

$("#reduction-toggle").children("span").html("hide");

$("#toggle-icon").attr({src:"images/pfeil-blau-u.gif", id:
"toggle-icon", alt: ""});
}
});
// make sure nothing happens with the link:
this.blur();
return false;
});
}
});

HTML:

Title
content

+++


What is wrong with that? IE will hide the div, but no link-markup is
inserted to the html.
Thanks for any hint or shove in the right direction...
Tom




[jQuery] Re: Java Errors when using .Accordion and .innerfade - Please help :)

2007-07-25 Thread Aaron

Anyone have ideas on this one?

I would greatly appreciate the help! :)

On Jul 25, 10:03 am, Aaron <[EMAIL PROTECTED]> wrote:
> ok so after looking in fire bug it says the error is in the
> jquery.accordian.js
>
> and is
>
> jQuery(":first-child", this)[0] has no properties
> Accordion(Object showSpeed=250 hideSpeed=250
> header=div.title)jquery.accordion (line 174)
> (no name)()Common.js (line 25)
> e()jquery.js (line 11)
> e()jquery.js (line 11)
> e([function(), function()], function(), undefined)jquery.js (line 11)
> e()jquery.js (line 11)
> [Break on this error] header: jQuery(':first-child', this)
> [0].tagName // take first childs tagName ...
>
> On Jul 25, 9:58 am, Aaron <[EMAIL PROTECTED]> wrote:
>
>
>
> > I can post the url but you have to change your host file since it is a
> > testing site currently until they go live.
>
> > the url ishttp://stage.itsyourworld.org/wac/Default.aspandthe ip to
> > put in your host file is 63.87.221.69 stage.itsyourworld.org
>
> > i will also take a look in firefox and see if i can see exactly where
> > the error is.
>
> > Thanks so much for the help! :)
>
> > On Jul 25, 9:43 am, Stephan Beal <[EMAIL PROTECTED]> wrote:
>
> > > On Jul 25, 4:37 pm, Aaron <[EMAIL PROTECTED]> wrote:
>
> > > > Can someone please help?
> > > ...
> > > > But this still is not working and giving me an error. If i use just
> > > > one of them they work fine but when i try and use both of them i get
> > > > this javascript error.
> > > > 0.tagname is null or not an object
>
> > > Can you post a URL to a page demonstrating this problem? The error
> > > happens in some code outside what you have shown use (in one of the
> > > included .js files) and we cannot know where that error happens. If
> > > you can post a page showing the problem, someone with Firebug
> > > installed can quickly localize it.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -



[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread John Resig


It has nothing to do with jQuery - unfortunately, Firebug is really...
buggy. I find that if I leave it open for too long it'll simply start
throwing these errors randomly, on any page. It's really unfortunate.
I wouldn't worry about how you have things written.

--John

On 7/25/07, RwL <[EMAIL PROTECTED]> wrote:


Not sure if this is my code's problem or Firefox's... I don't seem to
be throwing any JS errors in MSIE. Here's what I'm doing:

$("a").not($("#nav a")).click(function() { alert('Sorry, links are
disabled in this demo except those under Profile Navigation.'); return
false; });

The selectors seem to be doing just what I want; the alert gets thrown
as expected, but when you OK the alert Firebug suddenly throws in
anwhere from 15-40 "Too Much Recursion" errors with no other details.

Sorry, I think I should probably be able to solve this with some
Google searches but I'm not quite getting a clear enough picture yet.




[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Klaus Hartl


RwL wrote:

You don't need to wrap the parameter to not in $(...). Maybe try:

$("a").not("#nav a").click(function() { alert('...'); return false; });


You know, that's what I thought too, but the "not" selection didn't
work at all until I wrapped my NOT selection with $() -- that is, #nav
a was still getting the alert onclick.

And the too much recursion error appears regardless of whether it's
not("#nav a") or not($("#nav a")).

Strange, right?


If you use not() with an expression, it will only work with so called 
simple selectors.


"A simple selector is either a type selector or universal selector 
followed immediately by zero or more attribute selectors, ID selectors, 
or pseudo-classes, in any order. The simple selector matches if all of 
its components match."


http://www.w3.org/TR/CSS21/selector.html#selector-syntax
http://docs.jquery.com/DOM/Traversing#not.28_expr_.29


Regarding using a set of elements to exclude I found this in the docs:

"Please note: the expression cannot use a reference to the element name. "
http://docs.jquery.com/DOM/Traversing#not.28_elems_.29


That said, $("a").not( $("#nav a") ) is not supposed to work if I 
understood that correctly. Also see the example in the link.


The following would, given all the links in #nav belong to a class of "nav"

$("a").not("#nav a.nav")

Let's not add classes only for that purpose. Maybe you can also try to 
workaround this limitation by selecting not by type but href attribute 
which is only allowed for links:


$("a").not("#nav [EMAIL PROTECTED]")


HTH


--Klaus




[jQuery] Re: triggering a custom event is not working

2007-07-25 Thread Brandon Aaron

Hey Jeff,

Sorry for the long delay in getting back to you on this. I just ran this
code in Firebug on my blog and everything worked good.

$('h1').bind('mouseover', function(e) { $(this).trigger('myEvent');
}).bind('myEvent', function(e) { console.log(e.type); });

Make sure you are using the latest version of jQuery which is 1.1.3.1.

If you can, post up an example page that exhibits the problem. Did you get a
js error in your page?

--
Brandon Aaron

On 7/24/07, Jeff L <[EMAIL PROTECTED]> wrote:


Hi everyone,
I'm trying to bind a custom event and then use trigger() to trigger it,
but it's not working for me.

Here's my code, does anyone see any issues?

Currently it's logging 'mouseout' but not 'my Event' as I mouse over my
table cells.

   $(o).mouseout( function(event) {
console.log('mouseout');
$(event.target).trigger('myEvent');
}).bind("myEvent",function(event) {
console.log('my Event');
});


Any help is appreciated!!


Jeff


[jQuery] Re: Possible to retrieve image data via AJAX for display?

2007-07-25 Thread Dan G. Switzer, II

>Am Mittwoch, 25. Juli 2007 schrieb Rob Desbois:
>> Yes, sorry I didn't phrase my post very well: there is a URL for the
>image,
>> of course, but I was trying to emphasise that there isn't a URL to an
>image
>> cached on the server's filesystem to pass back, as I don't want to
>> *permanently* cache the image (or implement a cleverer algorithm -
>there's
>> no need).
>> I simply want the cached image (or intermediates) to be temporary; the
>> user's session seems the obvious candidate for this type of storage to
>me.
>
>var ctx = $('canvas')[0].getContext("2d");
>var img = new Image();
>img.onload = function() {
>  ctx.drawImage(img,0,0);
>  ctx.beginPath();
>  ctx.moveTo(30,96);
>  ctx.lineTo(70,66);
>  ctx.lineTo(103,76);
>  ctx.lineTo(170,15);
>  ctx.stroke();
>  // ...
>}
>img.src = "/basicImage.png";

I believe the ctx variable should be:

var ctx = $('')[0].getContext("2d");

The $('canvas') would be looking for an existing  canvas tag, where
$("") will create one (just like document.createElement("canvas")
would.)

-Dan



[jQuery] Ajax: (Didn't have time to go over posted messages)

2007-07-25 Thread andreas

Are custom headers (x-*) supported in the current version of Jquery ?

If not any quick workarounds ?

Didn't have time to go over the posts in the group and i would
appreciate answers/tips cause i need to deploy an app. based heavily
on async calls and custom headers will be required in many occasions.


thank you.



[jQuery] Re: Follow me to best pratice in create plugin to jQuery

2007-07-25 Thread Dan G. Switzer, II

>Dan, thanks for your suggestion too.
>
>What´s the plugin does is clear and reset the value of the elements.
>So, clearDefaultValue or resetDefaultValue are good suggestions. What
>do you think about?

Well I'm still not in love with it, "resetDefaultValue" might be more
clear--as the goal is to reset the default value in the field if the user
leaves the field blank.

-Dan



[jQuery] Re: $(document).ready behavior when using $("#div").load

2007-07-25 Thread Dan G. Switzer, II

Your question is one that crops up frequently on this list.

1) The $(document).ready() only fires *once* per page load--and that's when
the root document's DOM is ready.

2) The $.load() method loads a DOM fragment--not a complete document object.
In a nutshell, this means your just added some additional HTML to an
existing page.

So, putting a $(document).ready() statement inside a page inserted into the
DOM via the $.load() method is not expected to work.

The correct way to trigger code off after the DOM fragment has been inserted
into the document is to use the callback in the $.load() method.

$("#feeds").load("feeds.html", null, function (){
alert("Hey, I loaded!");
});

One of the nice benefits to the callback method as well is all your JS is on
one spot--not divided amongst templates.

-Dan


>-Original Message-
>From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>Behalf Of [EMAIL PROTECTED]
>Sent: Wednesday, July 25, 2007 11:25 AM
>To: jQuery (English)
>Subject: [jQuery] $(document).ready behavior when using $("#div").load
>
>
>I am using some javascript in the $(document).ready function to decide
>which content gets shown.  My problem is that this never gets executed
>when i load this page into a div on another page.  The below has been
>stripped of some other things i am doing, FYI.
>This is in the page with the content:
>
>$(document).ready(function(){
>
>   if(notvalidated){
>   var thisContent = 'You are not authorized';
>   $("body").empty();
>   $("body").append(thisContent);
>   }
>});
>
>And this is in the page where i would load the content:
>
>$(document).ready(function(){
>   $("#clickMe").click(
>   function(){
>
$('#contentDiv').fadeOut(1200,function() {
>
>   $('#contentDiv').load('content.html').fadeIn(1200);
>   });
>   return false;
>   });
>});
>
>When i just visit the content page, i get "You are not authorized".
>But when i load the content into the div, i get the full content,
>which leads me to believe that the document.ready function is not
>running at the time the content is pulled.  Does anyone have any
>pointers?  Am I missing something?
>
>Regards,
>-jesse-
>




[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mike Alsup


:-)  Mike, I just reread your email and see that you pointed this out
already!   Sorry!

Mike

On 7/25/07, Mike Alsup <[EMAIL PROTECTED]> wrote:

> It would have been far better if "each" passed the DOM element as
> an argument to the inner function, instead of using "this":

It does pass the element, so if you prefer you could write code like:

$('.stuff').each(function(index, element) {
element.style.visibility = 'hidden';
});


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Klaus Hartl


Michael Geary wrote:

Rob, I think you left out the return statement that you meant to put in. :-)

(Outstanding explanation, BTW!)

For clarity, it could be:

   jQuery.fn.toggleVis = function() {
  this.each(function() {
 if (this.style.visibility == 'hidden') {
this.style.visibility = 'visible';
 } else {
this.style.visibility = 'hidden';
 }
  });
  return this;
   };

Or, taking advantage of the fact that "each" returns "this" for convenience:

   jQuery.fn.toggleVis = function() {
  return this.each(function() {
 if (this.style.visibility == 'hidden') {
this.style.visibility = 'visible';
 } else {
this.style.visibility = 'hidden';
 }
  });
   };

Mitch, take careful note that "this" means two different things in that
code:

   jQuery.fn.toggleVis = function() {
  /* Here, "this" is the jQuery object */
  return this.each(function() {
 /* Here, "this" is a DOM element */
 if (this.style.visibility == 'hidden') {
this.style.visibility = 'visible';
 } else {
this.style.visibility = 'hidden';
 }
  });
   };

The use of "this" inside an "each" loop is one of the two major design
errors in jQuery (the other being the event system, which I'll get to
another day). It is the source of a great deal of confusion. It would have
been far better if "each" passed the DOM element as an argument to the inner
function, instead of using "this":

   /* Non-working code as an example of what could have been */
   jQuery.fn.toggleVis = function() {
  return this.each( function( element ) {
 if (element.style.visibility == 'hidden') {
element.style.visibility = 'visible';
 } else {
element.style.visibility = 'hidden';
 }
  });
   };

To me at least, that code is *much* easier to follow.

Now it does turn out that the DOM element is passed as an argument to the
"each" inner function, but it's the second argument, not the first. The
first argument is the array index (0 through n). That's unfortunate, since
you rarely need the index but always need the element. But at least you can
code:

   jQuery.fn.toggleVis = function() {
  return this.each( function( index, element ) {
 if (element.style.visibility == 'hidden') {
element.style.visibility = 'visible';
 } else {
element.style.visibility = 'hidden';
 }
  });
   };

That capability didn't exist in the first versions of jQuery - it was added
somewhat later - so you'll often see another approach in existing jQuery
code:

   jQuery.fn.toggleVis = function() {
  return this.each( function() {
 var element = this;
 if (element.style.visibility == 'hidden') {
element.style.visibility = 'visible';
 } else {
element.style.visibility = 'hidden';
 }
  });
   };

-Mike


From: Rob Desbois

Within the function passed to .each(), 'this' refers to the 
actual DOM element we are currently dealing with, so that 
part of the code is now alright.
It still won't allow you to chain function calls though, so 
one final touch is to return the result of .each(), and we're done: 



jQuery.fn.toggleVis = function() {
   this.each(function() {
  if (this.style.visibility == 'hidden') {
 this.style.visibility = 'visible';
  } else {
 this.style.visibility = 'hidden';
  }
   });
};





Haha, I just couldn't help myself, let's shorten the code and not type 
the same three times:


jQuery.fn.toggleVis = function() {
return this.each(function() {
var visibility = this.style.visibility;
visibility = visibility == 'hidden' ? 'visible' : 'hidden';
});
};


--Klaus


[jQuery] Re: jQuery capture images from webcam

2007-07-25 Thread Web Specialist

Thanks Tane.

Yes, our ColdFusion application will serve us with visitor image captured
from webcam and stored in application directory. After that I'll display in
our application where users(application) will "crop" that visitor image. Mr
Google help me and gives me this great great piece of code:

http://www.phzzy.org/code/cropper/

and the best(using prototype):

http://www.defusion.org.uk/demos/060519/cropper.php

I'll be reading carefully this last example.

Cheers



2007/7/25, Tane Piper <[EMAIL PROTECTED]>:



There is no way AFAIK for JavaScript to capture a webcam stream, like
Flash can capture the stream.  But JavaScript can capture the image
from an HTTP stream.  I got this code from
http://web.nickshanks.com/code/js/cams

newImage = new Image();

function LoadNewImage() {
var unique = new Date();
document.images.webcam.src = newImage.src;
newImage.src = "http://path/to/webcam.jpeg?time="; + unique.getTime();
}

If the users webcam is being served by an application that can serve
the image via HTTP, then you could capture an image from their stream
using this and then manipulate it.

On 7/25/07, Web Specialist <[EMAIL PROTECTED]> wrote:
> jQuery haves plugins available for web images capture? I'm developing a
> ColdFusion application to store visitors personal data including your
photo.
> What I'm looking for:
>
> - webcam captures visitor photo via iframe(or another solution) in our
form
> application;
> - users(application) can cut that photo via jQuery;
> - after all that image is saved in our server;
>
> Is it a dream? ;-)
>
> Cheers
>
>
>


--
Tane Piper
http://digitalspaghetti.tooum.net

This email is: [ ] blogable [ x ] ask first [ ] private



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Mike Alsup



It would have been far better if "each" passed the DOM element as
an argument to the inner function, instead of using "this":


It does pass the element, so if you prefer you could write code like:

$('.stuff').each(function(index, element) {
   element.style.visibility = 'hidden';
});

Personally, I prefer using 'this'.  I understand that it's more
confusing to learn initially, but once you get it I think it makes a
lot of sense.

Mike


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Karl Swedberg

On Jul 25, 2007, at 12:26 PM, Rob Desbois wrote:
I see now that an object in jQuery does not have a visibility  
directly, it needs a class assigned to it, so that is why example 2  
doesn't work.


Not entirely sure what you mean by this..?


Well, the main point is that the jQuery object is not the same as a  
DOM element. It doesn't necessarily need a class assigned to it to  
change the visibility, but that's the approach we took in the early  
chapters of the book to demonstrate basic jQuery components: $ 
('someSelector').addClass('class') and $('someSelector').removeClass 
('class')


jQuery has its own method to access and modify CSS properties: .css().

So, $('#myDiv').css('visibility') would return the same value as  
document.getElementById('myDiv').style.visibility


Except, I think, .css('visibility') will return "visible" if the  
element is visible, even if its style attribute isn't explicitly set  
to "visiblity: visible" whereas the .style.visibility will return  
"visible" only if that's what the element's style attribute says.


I hope I'm not clouding the issue here. Ideally, modifying  
presentation based on class as its defined in a stylesheet is the way  
to go. But, Mitchell, I think you'll see later in the book (chapter  
5?) that there are times when it's necessary to calculate a css value  
in your script, so .css() works great for those occasions.


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com






[jQuery] Re: jQuery capture images from webcam

2007-07-25 Thread Tane Piper


There is no way AFAIK for JavaScript to capture a webcam stream, like
Flash can capture the stream.  But JavaScript can capture the image
from an HTTP stream.  I got this code from
http://web.nickshanks.com/code/js/cams

newImage = new Image();

function LoadNewImage() {
   var unique = new Date();
   document.images.webcam.src = newImage.src;
   newImage.src = "http://path/to/webcam.jpeg?time="; + unique.getTime();
}

If the users webcam is being served by an application that can serve
the image via HTTP, then you could capture an image from their stream
using this and then manipulate it.

On 7/25/07, Web Specialist <[EMAIL PROTECTED]> wrote:

jQuery haves plugins available for web images capture? I'm developing a
ColdFusion application to store visitors personal data including your photo.
What I'm looking for:

- webcam captures visitor photo via iframe(or another solution) in our form
application;
- users(application) can cut that photo via jQuery;
- after all that image is saved in our server;

Is it a dream? ;-)

Cheers






--
Tane Piper
http://digitalspaghetti.tooum.net

This email is: [ ] blogable [ x ] ask first [ ] private


[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Michael Geary

Rob, I think you left out the return statement that you meant to put in. :-)

(Outstanding explanation, BTW!)

For clarity, it could be:

   jQuery.fn.toggleVis = function() {
  this.each(function() {
 if (this.style.visibility == 'hidden') {
this.style.visibility = 'visible';
 } else {
this.style.visibility = 'hidden';
 }
  });
  return this;
   };

Or, taking advantage of the fact that "each" returns "this" for convenience:

   jQuery.fn.toggleVis = function() {
  return this.each(function() {
 if (this.style.visibility == 'hidden') {
this.style.visibility = 'visible';
 } else {
this.style.visibility = 'hidden';
 }
  });
   };

Mitch, take careful note that "this" means two different things in that
code:

   jQuery.fn.toggleVis = function() {
  /* Here, "this" is the jQuery object */
  return this.each(function() {
 /* Here, "this" is a DOM element */
 if (this.style.visibility == 'hidden') {
this.style.visibility = 'visible';
 } else {
this.style.visibility = 'hidden';
 }
  });
   };

The use of "this" inside an "each" loop is one of the two major design
errors in jQuery (the other being the event system, which I'll get to
another day). It is the source of a great deal of confusion. It would have
been far better if "each" passed the DOM element as an argument to the inner
function, instead of using "this":

   /* Non-working code as an example of what could have been */
   jQuery.fn.toggleVis = function() {
  return this.each( function( element ) {
 if (element.style.visibility == 'hidden') {
element.style.visibility = 'visible';
 } else {
element.style.visibility = 'hidden';
 }
  });
   };

To me at least, that code is *much* easier to follow.

Now it does turn out that the DOM element is passed as an argument to the
"each" inner function, but it's the second argument, not the first. The
first argument is the array index (0 through n). That's unfortunate, since
you rarely need the index but always need the element. But at least you can
code:

   jQuery.fn.toggleVis = function() {
  return this.each( function( index, element ) {
 if (element.style.visibility == 'hidden') {
element.style.visibility = 'visible';
 } else {
element.style.visibility = 'hidden';
 }
  });
   };

That capability didn't exist in the first versions of jQuery - it was added
somewhat later - so you'll often see another approach in existing jQuery
code:

   jQuery.fn.toggleVis = function() {
  return this.each( function() {
 var element = this;
 if (element.style.visibility == 'hidden') {
element.style.visibility = 'visible';
 } else {
element.style.visibility = 'hidden';
 }
  });
   };

-Mike

> From: Rob Desbois
> 
> Within the function passed to .each(), 'this' refers to the 
> actual DOM element we are currently dealing with, so that 
> part of the code is now alright.
> It still won't allow you to chain function calls though, so 
> one final touch is to return the result of .each(), and we're done: 
> 
> 
>   jQuery.fn.toggleVis = function() {
>  this.each(function() {
> if (this.style.visibility == 'hidden') {
>this.style.visibility = 'visible';
> } else {
>this.style.visibility = 'hidden';
> }
>  });
>   };



[jQuery] ANNOUNCE: Grid Column Sizing v.0.5 plugin released !

2007-07-25 Thread emelendez

This plugin, applied to a number of HTML tables, provides the
behaviour of resizing their columns by dragging the mouse or double-
clicking over a "handler hint".

My first (serious) jQuery plugin (be benevolent!)

check it out in: http://jquery.com/plugins/project/gridColumnSizing



[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread RwL

> You don't need to wrap the parameter to not in $(...). Maybe try:
>
> $("a").not("#nav a").click(function() { alert('...'); return false; });

You know, that's what I thought too, but the "not" selection didn't
work at all until I wrapped my NOT selection with $() -- that is, #nav
a was still getting the alert onclick.

And the too much recursion error appears regardless of whether it's
not("#nav a") or not($("#nav a")).

Strange, right?



[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Jonathan Sharp

This could also be written as:

$('a').click(function() {
   if ($(this).parents('#nav').size() == 0) {
  alert('...');
  return false;
   }
});

-js


On 7/25/07, Erik Beeson <[EMAIL PROTECTED]> wrote:


You don't need to wrap the parameter to not in $(...). Maybe try:

$("a").not("#nav a").click(function() { alert('...'); return false; });

--Erik

On 7/25/07, RwL <[EMAIL PROTECTED]> wrote:
>
>
> Not sure if this is my code's problem or Firefox's... I don't seem to
> be throwing any JS errors in MSIE. Here's what I'm doing:
>
> $("a").not($("#nav a")).click(function() { alert('Sorry, links are
> disabled in this demo except those under Profile Navigation.'); return
> false; });
>
> The selectors seem to be doing just what I want; the alert gets thrown
> as expected, but when you OK the alert Firebug suddenly throws in
> anwhere from 15-40 "Too Much Recursion" errors with no other details.
>
> Sorry, I think I should probably be able to solve this with some
> Google searches but I'm not quite getting a clear enough picture yet.
>
>



[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Erik Beeson

You don't need to wrap the parameter to not in $(...). Maybe try:

$("a").not("#nav a").click(function() { alert('...'); return false; });

--Erik

On 7/25/07, RwL <[EMAIL PROTECTED]> wrote:



Not sure if this is my code's problem or Firefox's... I don't seem to
be throwing any JS errors in MSIE. Here's what I'm doing:

$("a").not($("#nav a")).click(function() { alert('Sorry, links are
disabled in this demo except those under Profile Navigation.'); return
false; });

The selectors seem to be doing just what I want; the alert gets thrown
as expected, but when you OK the alert Firebug suddenly throws in
anwhere from 15-40 "Too Much Recursion" errors with no other details.

Sorry, I think I should probably be able to solve this with some
Google searches but I'm not quite getting a clear enough picture yet.




[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread RwL

> Not sure if this is my code's problem or Firefox's... I don't seem to
> be throwing any JS errors in MSIE. Here's what I'm doing:

Turned on Safari's JS Console and no errors there either. Hmm.



[jQuery] Re: Possible to retrieve image data via AJAX for display?

2007-07-25 Thread Klaus Hartl


Rob Desbois wrote:

 > I never noticed that they ever were browser-independent.
I know, that's why I said 'that IE has supported for years' and why I 
can't use them.


Despite the ways there are to do this such as these canvas projects or 
something big and bulky client-side (Java, Flash possibly, any number of 
similar technologies), what baffles me most is that you can inject 
content client-side into many tags: script, style, div, title, all of 
the things which contain HTML or text. But you can't do that with the 
specialised tags like img, object and applet. Granted these do not 
contain HTML, but then neither do script and style.
It just seems peculiar to me that there is this mismatch - why wouldn't 
HTML have the capability to support, e.g. GIF89a...binary 
rubbish...?


It does, using the data URI scheme, I just remembered to have read about 
it somewhere...:




Of course it isn't supported in IE...

http://en.wikipedia.org/wiki/Data:_URI_scheme



--Klaus


[jQuery] Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread RwL

Not sure if this is my code's problem or Firefox's... I don't seem to
be throwing any JS errors in MSIE. Here's what I'm doing:

$("a").not($("#nav a")).click(function() { alert('Sorry, links are
disabled in this demo except those under Profile Navigation.'); return
false; });

The selectors seem to be doing just what I want; the alert gets thrown
as expected, but when you OK the alert Firebug suddenly throws in
anwhere from 15-40 "Too Much Recursion" errors with no other details.

Sorry, I think I should probably be able to solve this with some
Google searches but I'm not quite getting a clear enough picture yet.



[jQuery] Re: Toggling an objects visiblty without show and hide

2007-07-25 Thread Rob Desbois


Unfortunately my code does work J. Must be a miracle?


The one where you used 'this' instead of 'cheshireCat' didn't work - that
was the one I was referring to. My last post clears that up a bit more
understandably I hope.


I just got my copy of Learning jQuery and it's a very good book (took 10
days to get here). Some really basic concepts that got away from me are
finally becoming clear.


Excellent - good luck with it!


I know enough Javascript, my main issue is not understanding the domain of
jQuery and the domain of JS, and how the two differ, but the book is making
that clear. Also the book helps me understand that jQuery is really about
manipulating elements in the DOM using selectors and traversing the DOM. I
think that is where I went astray. I don't think you need to dive deep into
JS to grok jQ, but the syntax closeness of the two can be tricky, and not
explained well in the tutorials. Like the book spends a lot of time
explaining $() which it calls the Factory function.


Ok, I hope my post didn't offend in any way. Re-reading your posts, I think
your conclusion is correct - understanding what is jQuery and what is JS,
and the differences, can be tricky. I'm not so sure about not needing a good
understanding of JS - really getting to grips with relatively advanced
topics like closures is quite important IMO - I certainly struggled with
some bits of JS I'd never seen before coming to jQuery, especially when
extending jQuery yourself.


I see now that an object in jQuery does not have a visibility directly, it
needs a class assigned to it, so that is why example 2 doesn't work.


Not entirely sure what you mean by this..?


PS I have read all the tutorials at http://docs.jquery.com/Tutorials and
honestly they assume a lot of prior knowledge and leave out some really
major lessons for the newbie.


PSS I am not sure your metaphor is right, but I agree that the bigger

picture needs amplifying on the docs site, and maybe I will end up
contributing to that issue, which is not to be critical of the community in
any way, you guys are all fabulous and very generous.


In what sort of areas do you think too much is assumed in the tutorials?
I'm not so sure about the metaphor - jQuery is a tool, the use of which
requires knowledge and understanding of how you use that tool, as with
anything. I would strongly advise anyone wanting to use jQuery to learn
JavaScript first, but that is my opinion - you think otherwise, perhaps the
rest of the community would disagree with me too ;-)

In terms of adding to the docs I'm sure nobody will be offended. We all
approach learning a new language / tool / platform in different ways, if you
found that the existing reference and tutorials were not sufficient or
appropriate for you then there are probably others in a similar situation.
By going through the hard part and contributing yourself, you add your own
viewpoint which might be just what someone else needs, which can only be a
good thing.

--rob

*From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On

Behalf Of *Rob Desbois
*Sent:* Wednesday, July 25, 2007 2:14 AM
*To:* jquery-en@googlegroups.com
*Subject:* [jQuery] Re: Toggling an objects visiblty without show and hide



Ganeshji,
Correct, As Aaron states above, 'this' refers to the jQuery object, hence
this code will not work.

Mitch,
As I can see it I think you're misunderstanding how jQuery works from the
outside at quite a fundamental level. Did you run through the tutorials at
http://docs.jquery.com/Tutorials ? At the very least, John and Joern's
tutorials - the top two - are an excellent introduction.
Also IIRC from your other posts you aren't overly-familiar with JavaScript
itself. I don't know of other people's opinions and am not speaking for the
jQuery community, but I would really recommend learning JavaScript on its
own to a competent level before attempting to use jQuery, otherwise it's
hard for you to know which conventions, problems and bits of code are
JavaScript, and which are jQuery. It would be like trying to learn MFC
(Microsoft Foundation Classes - the old MS C++ class hierarchy wrapping the
Windows API) before being able to code in C++.
Granted, jQuery is massively more simple than MFC, but JavaScript is a
much more complicated language than some appreciate (I'm currently
struggling with some aspects). Walk before you can run.

--rob

On 7/25/07, *Ganeshji Marwaha* <[EMAIL PROTECTED]> wrote:

> jQuery.fn.toggleVis = function() {
>if(this.style.visibility == 'hidden') {
>  this.style.visibility = 'visible';
>} else {
>this.style.visibility = 'hidden';
>}
> };


doesn't "this" here refer to the jquery object... I don't think jquery
object has a style attribute, or does it?



-GTG




On 7/24/07, *Stephan Beal* <[EMAIL PROTECTED] > wrote:


On Jul 25, 12:41 am, "Mitchell Waite" < [EMAIL PROTECTED] > wrote:
> I know this is trivial but what it turned out I needed was something
this
> si

[jQuery] Re: jQuery capture images from webcam

2007-07-25 Thread Charles Capps

Web Specialist wrote:
> jQuery haves plugins available for web images capture? I'm developing a
> ColdFusion application to store visitors personal data including your
> photo. What I'm looking for:
> 
> - webcam captures visitor photo via iframe(or another solution) in our
> form application;
> - users(application) can cut that photo via jQuery;
> - after all that image is saved in our server;
> 
> Is it a dream? ;-)
> 
> Cheers
> 
> 


To the best of my knowledge, the only way to capture anything webcamish
from a user is to use Flash.  There aren't any plugins that I know of
that Javascript could interface with to accomplish that goal.


[jQuery] Re: 3 state buttons - is there a best way

2007-07-25 Thread Mitchell Waite
I think this is a good topic, but agree it's off the center.

 

I am intimately family with the stretchable button approach. 

 

Almost all web designers who make button understand its limits and where it
works well. It has its place and We use it to the extreme at

 

http://identify.whatbird.com/obj/388/_/Lesser_Sand-Plover.aspx

 

Check the sexy tabs and how they have curved edges. That was not easy.

 

Regarding your point about the sliding door and using the same elements
instead of making new graphics, that's not really true if you use rounded
corners. Your corners will look worse when they are stretched vertically. In
the final analysis if you want pretty it's going to have to be separate
graphics.

 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott Sauyet
Sent: Wednesday, July 25, 2007 7:48 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: 3 state buttons - is there a best way

 

 

Mitchell Waite wrote:

> "Limits the artwork" in the sense the middle portion of all you images 

> must be a stretched background slice, so you can't reproduce all the 

> subtle affects of switching images. You have to produce the end caps 

> from a sliced piece of artwork so this sort of tosses out a lot of high 

> quality graphics.

 

Yes, that's one of the limitations of this technique.  But it's there to 

facilitate something difficult with other techniques: with the sliding 

door technique, you can use the same artwork and still allow varying 

sized items.  Instead of creating a button for the text "foo" and a 

different one for the text "foobarbaz", a single graphic will do both. 

This only works if you can use an image whose horizontal center will 

stretch well, but many button and tab images are like that anyway, as 

you want consistency among the various sized buttons.

 

If it stretches in the vertical direction too (think bottoms of tab 

images) then you automatically handle text resizing too.  It's a pretty 

nice technique.

 

But this is pretty far from JQuery at this point, so I'll shut up.

 

   -- Scott

 



[jQuery] Superfish with interface plugin ...

2007-07-25 Thread TiGeRWooD

Hi,

I tried to used superfish, but i have a bug in IE7 (not tried in ie6),
superfish doesn't work well if the interface plugin is loaded ...

the first submenu are visible but the sub sub menu don't ...

If anyone have ideas ... you 're welcome :)

Thanks in advance.



  1   2   >