[jQuery] Re: Image resizing

2007-06-23 Thread Glen Lipka

Felix Geisend hooked me up with some code, which seemed to work perfectly.

function fitObjectInViewPort(zoomedImage)
{
   // Fit's our image in a box with a given width and heigth while
proportions remain,
   // *or* resizes it based on one site proportionally if only width or
height is given

   var objectWidth = zoomedImage.width();
   var objectHeight = zoomedImage.height();

   var boxWidth = ($(window).width()) * maxImagePercent;
   var boxHeight = ($(window).height()) * maxImagePercent;

   widthRatio  = (boxWidth / objectWidth);
   heightRatio = (boxHeight / objectHeight);

   if ((widthRatio < heightRatio) && (widthRatio!=0) || (heightRatio==0))
   {
   ratio = widthRatio;
   }
   else
   {
   ratio = heightRatio;
   }

   new_width = Math.ceil(objectWidth * ratio);
   new_height = Math.ceil(objectHeight * ratio);

   //return array(new_width, new_height);

   new_left = (boxWidth - new_width) / 2;
   new_top = (boxHeight - new_height) / 2;

 bigThumb.animate({width:new_width,height:new_height}, {duration: 750,
easing: "backinout"});

}

My math to figure out how to center it in the viewport is a little sketchy,
but I feel like it's making progress.

Thanks Felix!

Glen

On 6/23/07, Glen Lipka <[EMAIL PROTECTED]> wrote:


I'm sorry I am asking so many questions about this.
Still working on this EaseBox thing.
http://www.commadot.com/jquery/easebox/

My question has to do with finding the proper image size based on the
viewport.

Logic:
maximum height and width of the zoomed image is a percentage of the
viewport.
var maxPercentage = 90%;
this means that height nor width can be more than 90% of the viewport.

if they are both less, then it should maximize to full size.

if width is more and height it less
it should reduce width to maxPercentage and keep height proportional
and vice versa for height more, but width less.

if height and width are higher, then it should pick the one that is higher
and reduce that to maxPercentage of either height orwidth of viewport
depending on which one is more.

Once the image size is calculated, it should center it in the viewport
horizontally and vertically.  I guess that is
left: viewport width - image width /2
top: viewport height- image height/2

Is that right?

Man, this is making me dizzy.

Then I have to put these variables into an animate function.
What is the syntax to do that?

Any help is greatly appreciated.

Glen



[jQuery] Re: Overlay plugin?

2007-06-23 Thread Glen Lipka

Heh, I just started a different thread asking for this. :)
Trying to convert it out now.

Thanks!

( I am falling asleep at the wheel)

Glen

On 6/23/07, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:


 I want to maintain proportion, but scale it to fit in the view port.0

Got some PHP code laying around that does just that. Should be easy to
convert to JS:



function fitObjectInBox($objectWidth, $objectHeight, $boxWidth,
$boxHeight)
{
// Fit's our image in a box with a given width and heigth while
proportions remain,
// *or* resizes it based on one site proportionally if only width or
height is given
$widthRatio  = @($boxWidth / $objectWidth);
$heightRatio = @($boxHeight / $objectHeight);

if (($widthRatio < $heightRatio) && ($widthRatio!=0) ||
($heightRatio==0))
{
$ratio = $widthRatio;
}
else
{
$ratio = $heightRatio;
}

$new_width = ceil($objectWidth * $ratio);
$new_height = ceil($objectHeight * $ratio);

return array($new_width, $new_height);
}



HTH, Felix
--
My latest blog posts:

 [image: ThinkingPHP and 
beyond]

My Business: http://www.fg-webdesign.de


Glen Lipka wrote:

Sorry, working on it right now. :)
I fixed that.  Trying to figure out how to position it in the middle of
the screen and adjust the height width so it makes sense.
The logic is a little tortuous on my mind.

I want to maintain proportion, but scale it to fit in the view port.
Is there a resize plugin?

Glen

On 6/23/07, Aaron Heimlich <[EMAIL PROTECTED]> wrote:
>
> I got this error on FF 2.0.0.4 (Mac OS 10.4.10):
>
> e.css is not a function
> http://www.commadot.com/jquery/easebox/easeBox.js
> Line 59
>
> Stack trace:
>  showZoom(a matt-big.jpg)easeBox.js (line 59)
> (no name)()easeBox.js (line 27)
> (no name)( click clientX=0, clientY=0)jquery-latest.js (line 1398)
> handle (click clientX=0, clientY=0)jquery-latest.js (line 1302)
>  e.css("z-index","1001");
>
>
> On 6/24/07, Glen Lipka <[EMAIL PROTECTED] > wrote:
> >
> > dimScreen is great.
> > Check it out:
> > http://www.commadot.com/jquery/easebox/
> >
> > Although, I changed it slighly to use $(window).width() instead of
> > $(document).width()
> > This might only work with the dimensiosn plugin included.
> >
> > Glen
> >
> >  On 6/23/07, Glen Lipka < [EMAIL PROTECTED] > wrote:
> > >
> > > It should be Rey Bingo!
> > > That's exactly it.  Awesome.  Thanks. :)
> > >
> > > Glen
> > >
> > > On 6/23/07, Rey Bango < [EMAIL PROTECTED] > wrote:
> > > >
> > > >
> > > > dimScreen:
> > > >
> > > > http://docs.jquery.com/Plugins/dimScreen
> > > >
> > > > Glen Lipka wrote:
> > > > > I can't find it, but I vaguely remember someone had a plugin
> > > > that just
> > > > > puts a 50% opacity overlay over the page.
> > > > > Sort of like a thickbox thing, but without all the other stuff.
> > > > > Does anyone know where it is?
> > > > >
> > > > > Glen
> > > >
> > > > --
> > > > BrightLight Development, LLC.
> > > > 954-775- (o)
> > > > 954-600-2726 (c)
> > > > [EMAIL PROTECTED]
> > > > http://www.iambright.com
> > > >
> > >
> > >
> >
>
>
>  --
> Aaron Heimlich
> Web Developer
> [EMAIL PROTECTED]
> http://aheimlich.freepgs.com






[jQuery] Image resizing

2007-06-23 Thread Glen Lipka

I'm sorry I am asking so many questions about this.
Still working on this EaseBox thing.
http://www.commadot.com/jquery/easebox/

My question has to do with finding the proper image size based on the
viewport.

Logic:
maximum height and width of the zoomed image is a percentage of the
viewport.
var maxPercentage = 90%;
this means that height nor width can be more than 90% of the viewport.

if they are both less, then it should maximize to full size.

if width is more and height it less
it should reduce width to maxPercentage and keep height proportional
and vice versa for height more, but width less.

if height and width are higher, then it should pick the one that is higher
and reduce that to maxPercentage of either height orwidth of viewport
depending on which one is more.

Once the image size is calculated, it should center it in the viewport
horizontally and vertically.  I guess that is
left: viewport width - image width /2
top: viewport height- image height/2

Is that right?

Man, this is making me dizzy.

Then I have to put these variables into an animate function.
What is the syntax to do that?

Any help is greatly appreciated.

Glen


[jQuery] Re: Overlay plugin?

2007-06-23 Thread Felix Geisendörfer




I want to maintain proportion, but scale it to
fit in the view port.0
Got some PHP code laying around that does just that. Should be easy to
convert to JS:


function fitObjectInBox($objectWidth, $objectHeight, $boxWidth,
$boxHeight)
{
    // Fit's our image in a box with a given width and heigth while
proportions remain,
    // *or* resizes it based on one site proportionally if only width
or height is given
    $widthRatio  = @($boxWidth / $objectWidth);
    $heightRatio = @($boxHeight / $objectHeight);
    
    if (($widthRatio < $heightRatio) && ($widthRatio!=0) ||
($heightRatio==0))
    {
    $ratio = $widthRatio;
    }
    else
    {
    $ratio = $heightRatio;
    }
    
    $new_width = ceil($objectWidth * $ratio);
    $new_height = ceil($objectHeight * $ratio);
    
    return array($new_width, $new_height);
}


HTH, Felix
--
My latest blog posts:

  
 My Business: http://www.fg-webdesign.de





Glen Lipka wrote:
Sorry, working on it right now. :)
I fixed that.  Trying to figure out how to position it in the middle of
the screen and adjust the height width so it makes sense.
The logic is a little tortuous on my mind.
  
I want to maintain proportion, but scale it to fit in the view port.
  
Is there a resize plugin?
  
Glen
  
  On 6/23/07, Aaron Heimlich <[EMAIL PROTECTED]>
wrote:
  
  I
got this error on FF 
2.0.0.4 (Mac OS 10.4.10):

e.css is not a function
http://www.commadot.com/jquery/easebox/easeBox.js


Line 59

Stack trace:


showZoom(a
 matt-big.jpg)easeBox.js
(line 59)
(no name)()easeBox.js
(line 27)
(no name)(
click clientX=0, clientY=0)jquery-latest.js
(line 1398)
handle
(click clientX=0, clientY=0)jquery-latest.js
(line 1302)


e.css("z-index","1001");



On 6/24/07, Glen Lipka <[EMAIL PROTECTED]
> wrote:
dimScreen
is great.
Check it out:
  http://www.commadot.com/jquery/easebox/
  
  
Although, I changed it slighly to use $(window).width() instead of
$(document).width()
  
This might only work with the dimensiosn plugin included.
  
Glen
  
  
  On 6/23/07, Glen Lipka <
[EMAIL PROTECTED]
  > wrote:
  
  It
should be Rey Bingo!
That's exactly it.  Awesome.  Thanks. :)


Glen


On 6/23/07, Rey Bango <
[EMAIL PROTECTED]
> wrote:

dimScreen:
  
  http://docs.jquery.com/Plugins/dimScreen
  
Glen Lipka wrote:
> I can't find it, but I vaguely remember someone had a plugin that
just
  
> puts a 50% opacity overlay over the page.
> Sort of like a thickbox thing, but without all the other stuff.
  
> Does anyone know where it is?
>
> Glen
  
--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
  [EMAIL PROTECTED]
  http://www.iambright.com




  
  
  
  






-- 
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com


  
  





[jQuery] Re: Overlay plugin?

2007-06-23 Thread Glen Lipka

Sorry, working on it right now. :)
I fixed that.  Trying to figure out how to position it in the middle of the
screen and adjust the height width so it makes sense.
The logic is a little tortuous on my mind.

I want to maintain proportion, but scale it to fit in the view port.
Is there a resize plugin?

Glen

On 6/23/07, Aaron Heimlich <[EMAIL PROTECTED]> wrote:


I got this error on FF 2.0.0.4 (Mac OS 10.4.10):

e.css is not a function
http://www.commadot.com/jquery/easebox/easeBox.js
Line 59

Stack trace:
showZoom(a matt-big.jpg)easeBox.js (line 59)
(no name)()easeBox.js (line 27)
(no name)( click clientX=0, clientY=0)jquery-latest.js (line 1398)
handle (click clientX=0, clientY=0)jquery-latest.js (line 1302)
 e.css("z-index","1001");


On 6/24/07, Glen Lipka <[EMAIL PROTECTED]> wrote:
>
> dimScreen is great.
> Check it out:
> http://www.commadot.com/jquery/easebox/
>
> Although, I changed it slighly to use $(window).width() instead of
> $(document).width()
> This might only work with the dimensiosn plugin included.
>
> Glen
>
> On 6/23/07, Glen Lipka < [EMAIL PROTECTED] > wrote:
> >
> > It should be Rey Bingo!
> > That's exactly it.  Awesome.  Thanks. :)
> >
> > Glen
> >
> > On 6/23/07, Rey Bango < [EMAIL PROTECTED] > wrote:
> > >
> > >
> > > dimScreen:
> > >
> > > http://docs.jquery.com/Plugins/dimScreen
> > >
> > > Glen Lipka wrote:
> > > > I can't find it, but I vaguely remember someone had a plugin that
> > > just
> > > > puts a 50% opacity overlay over the page.
> > > > Sort of like a thickbox thing, but without all the other stuff.
> > > > Does anyone know where it is?
> > > >
> > > > Glen
> > >
> > > --
> > > BrightLight Development, LLC.
> > > 954-775- (o)
> > > 954-600-2726 (c)
> > > [EMAIL PROTECTED]
> > > http://www.iambright.com
> > >
> >
> >
>


--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com


[jQuery] Re: Easebox

2007-06-23 Thread Glen Lipka

Working on it.  All these little details.
I have to figure out how to position all this stuff.
Especially to make the image zoom to an appropriate size to the viewport.
Glen

On 6/23/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:



Glen Lipka wrote:
> I had a little bit of free time, so I started an "easeBox".  Like
> thickbox, but with easing transitions.
> http://www.commadot.com/jquery/easebox/#
Cool. I like it already.
>
> I made a list of things I want to do to it on it.
> Any suggestions to add to the list?
> Any suggestions of how I could improve the code?
> I have no idea how to make it into a plugin.
>
> Continuing to work on it, but help is greatly appreciated.
I like to be able to click somewhere in the document to hide any popups.
Navigating between images should be possible using the cursor keys. Any
other combination (n, p, ",", ";") seems very unintuitive.
Navigation images should be always in the same place, eg. lower right
corner. Posititiong them relative to the image is extremely annoying
when navigating between images with different sizes. You can't keep
clicking but have to target the button again and again.
Presentation wise a greyed out background and think black and white
borders are very nice. Make it look like a picture frame: Grey
background, think black border (>30px), thin white border (15-30px).
D&D and resizable seems to be rather useless as long as you can't open
more then one image at a time. ... Okay, its currently possible with
your script, but is that really useful?
For the gallery stuff I'd like to have one or more callbacks when the
user opens and closes and cycles between images. That would make it easy
to add some neat stuff like sounds of a slide projector.

For making it a plugin: There still is
http://docs.jquery.com/Plugins/Authoring available. Its not really
up-to-date but still a good reference. Apart from that you can learn a
lot by reading other's code.

--
Jörn Zaefferer

http://bassistance.de




[jQuery] Re: Overlay plugin?

2007-06-23 Thread Aaron Heimlich

I got this error on FF 2.0.0.4 (Mac OS 10.4.10):

e.css is not a function
http://www.commadot.com/jquery/easebox/easeBox.js
Line 59

Stack trace:
showZoom(a matt-big.jpg)easeBox.js (line 59)
(no name)()easeBox.js (line 27)
(no name)(click clientX=0, clientY=0)jquery-latest.js (line 1398)
handle(click clientX=0, clientY=0)jquery-latest.js (line 1302)
e.css("z-index","1001");


On 6/24/07, Glen Lipka <[EMAIL PROTECTED]> wrote:


dimScreen is great.
Check it out:
http://www.commadot.com/jquery/easebox/

Although, I changed it slighly to use $(window).width() instead of
$(document).width()
This might only work with the dimensiosn plugin included.

Glen

On 6/23/07, Glen Lipka <[EMAIL PROTECTED] > wrote:
>
> It should be Rey Bingo!
> That's exactly it.  Awesome.  Thanks. :)
>
> Glen
>
> On 6/23/07, Rey Bango < [EMAIL PROTECTED] > wrote:
> >
> >
> > dimScreen:
> >
> > http://docs.jquery.com/Plugins/dimScreen
> >
> > Glen Lipka wrote:
> > > I can't find it, but I vaguely remember someone had a plugin that
> > just
> > > puts a 50% opacity overlay over the page.
> > > Sort of like a thickbox thing, but without all the other stuff.
> > > Does anyone know where it is?
> > >
> > > Glen
> >
> > --
> > BrightLight Development, LLC.
> > 954-775- (o)
> > 954-600-2726 (c)
> > [EMAIL PROTECTED]
> > http://www.iambright.com
> >
>
>




--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com


[jQuery] Re: Overlay plugin?

2007-06-23 Thread Glen Lipka

dimScreen is great.
Check it out:
http://www.commadot.com/jquery/easebox/

Although, I changed it slighly to use $(window).width() instead of
$(document).width()
This might only work with the dimensiosn plugin included.

Glen

On 6/23/07, Glen Lipka <[EMAIL PROTECTED]> wrote:


It should be Rey Bingo!
That's exactly it.  Awesome.  Thanks. :)

Glen

On 6/23/07, Rey Bango <[EMAIL PROTECTED] > wrote:
>
>
> dimScreen:
>
> http://docs.jquery.com/Plugins/dimScreen
>
> Glen Lipka wrote:
> > I can't find it, but I vaguely remember someone had a plugin that just
> > puts a 50% opacity overlay over the page.
> > Sort of like a thickbox thing, but without all the other stuff.
> > Does anyone know where it is?
> >
> > Glen
>
> --
> BrightLight Development, LLC.
> 954-775- (o)
> 954-600-2726 (c)
> [EMAIL PROTECTED]
> http://www.iambright.com
>




[jQuery] Re: Overlay plugin?

2007-06-23 Thread Glen Lipka

It should be Rey Bingo!
That's exactly it.  Awesome.  Thanks. :)

Glen

On 6/23/07, Rey Bango <[EMAIL PROTECTED]> wrote:



dimScreen:

http://docs.jquery.com/Plugins/dimScreen

Glen Lipka wrote:
> I can't find it, but I vaguely remember someone had a plugin that just
> puts a 50% opacity overlay over the page.
> Sort of like a thickbox thing, but without all the other stuff.
> Does anyone know where it is?
>
> Glen

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



[jQuery] OT: Excellent Resource for Web Developers

2007-06-23 Thread Rey Bango


I generally try to avoid these types of post but I discovered a site 
called WebAppers which is really awesome. Its chock full of RIA, Ajax, 
JS and development posts which I'm finding very cool.


http://www.webappers.com/

Rey...




[jQuery] Re: Overlay plugin?

2007-06-23 Thread Rey Bango


dimScreen:

http://docs.jquery.com/Plugins/dimScreen

Glen Lipka wrote:
I can't find it, but I vaguely remember someone had a plugin that just 
puts a 50% opacity overlay over the page.

Sort of like a thickbox thing, but without all the other stuff.
Does anyone know where it is?

Glen


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


[jQuery] Re: Overlay plugin?

2007-06-23 Thread Ⓙⓐⓚⓔ

something like $('body').wrap('').parent().css('opacity',0.5)  ?


On 6/23/07, Glen Lipka <[EMAIL PROTECTED]> wrote:


This one is possibly more than I bargained for.  It's really cool though.
I'll try and use it.  I think I was thinking of one that was smaller and
didn't do quite as much.
Thanks for the tip though, I appreciate it.

Glen


On 6/23/07, rolfsf <[EMAIL PROTECTED]> wrote:
>
>
>
> blockUI perhaps?
> http://malsup.com/jquery/block/
>
>
>
> Glen Lipka wrote:
> >
> > I can't find it, but I vaguely remember someone had a plugin that just
>
> > puts
> > a 50% opacity overlay over the page.
> > Sort of like a thickbox thing, but without all the other stuff.
> > Does anyone know where it is?
> >
> > Glen
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Overlay-plugin--tf3971235s15494.html#a11272397
> Sent from the JQuery mailing list archive at Nabble.com.
>
>




--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: Overlay plugin?

2007-06-23 Thread Erik Beeson


jqModal also does that.

--Erik


On 6/23/07, Glen Lipka <[EMAIL PROTECTED]> wrote:

I can't find it, but I vaguely remember someone had a plugin that just puts
a 50% opacity overlay over the page.
Sort of like a thickbox thing, but without all the other stuff.
 Does anyone know where it is?

Glen



[jQuery] Re: Overlay plugin?

2007-06-23 Thread Glen Lipka

This one is possibly more than I bargained for.  It's really cool though.
I'll try and use it.  I think I was thinking of one that was smaller and
didn't do quite as much.
Thanks for the tip though, I appreciate it.

Glen


On 6/23/07, rolfsf <[EMAIL PROTECTED]> wrote:




blockUI perhaps?
http://malsup.com/jquery/block/



Glen Lipka wrote:
>
> I can't find it, but I vaguely remember someone had a plugin that just
> puts
> a 50% opacity overlay over the page.
> Sort of like a thickbox thing, but without all the other stuff.
> Does anyone know where it is?
>
> Glen
>
>

--
View this message in context:
http://www.nabble.com/Overlay-plugin--tf3971235s15494.html#a11272397
Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: Overlay plugin?

2007-06-23 Thread rolfsf


blockUI perhaps?
http://malsup.com/jquery/block/



Glen Lipka wrote:
> 
> I can't find it, but I vaguely remember someone had a plugin that just
> puts
> a 50% opacity overlay over the page.
> Sort of like a thickbox thing, but without all the other stuff.
> Does anyone know where it is?
> 
> Glen
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Overlay-plugin--tf3971235s15494.html#a11272397
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Overlay plugin?

2007-06-23 Thread Glen Lipka

I can't find it, but I vaguely remember someone had a plugin that just puts
a 50% opacity overlay over the page.
Sort of like a thickbox thing, but without all the other stuff.
Does anyone know where it is?

Glen


[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Glen Lipka

Nice work!  You might want to consider leveraging the hoverIntent plugin.
That way you would get unintentional zooms when you are moving past an image
quickly.

Again, looks cool.

Glen

On 6/23/07, Su <[EMAIL PROTECTED]> wrote:


This is neat.

On 6/23/07, Sean Catchpole <[EMAIL PROTECTED]> wrote:
>
> The feature I'm wondering about, is if the zoom2 image should inherit
> the classes of the original image. (If what I'm saying makes no sense,
> go view the source code of the zoomi page above)


Would it be a pain to make it optional? I ran into this decision when
working on my figures plugin[1], and ended up deciding that whether it was
needed or not was really going to depend upon the user and how their styling
was worked out.

I do have one fairly big objection, though: Your usage of the alt
attribute for the zoomed image is inappropriate and interferes with
accessibility. Using a filename for alt text is considered unacceptable, not
to mention that since you're having it refer to /another/ image, it's just
plain wrong.
Why not have Zoomi just look for something like
original-filename_zoomed.ext or something? It would actually cut down on
work for the user, for that matter.


[1] http://pioindustries.com/projects/jquery/figures  --See the "strip"
argument.



[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Benjamin Sterling

I agree with Su, you may be able to get away with using src and lowsrc, but
I am not totally sure what browsers are fully supporting lowsrc.

On 6/23/07, Su <[EMAIL PROTECTED]> wrote:


This is neat.

On 6/23/07, Sean Catchpole <[EMAIL PROTECTED]> wrote:
>
> The feature I'm wondering about, is if the zoom2 image should inherit
> the classes of the original image. (If what I'm saying makes no sense,
> go view the source code of the zoomi page above)


Would it be a pain to make it optional? I ran into this decision when
working on my figures plugin[1], and ended up deciding that whether it was
needed or not was really going to depend upon the user and how their styling
was worked out.

I do have one fairly big objection, though: Your usage of the alt
attribute for the zoomed image is inappropriate and interferes with
accessibility. Using a filename for alt text is considered unacceptable, not
to mention that since you're having it refer to /another/ image, it's just
plain wrong.
Why not have Zoomi just look for something like
original-filename_zoomed.ext or something? It would actually cut down on
work for the user, for that matter.


[1] http://pioindustries.com/projects/jquery/figures  --See the "strip"
argument.





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


[jQuery] Re: Triggering thickbox from a select dropdown

2007-06-23 Thread Andy Matthews

Su, that worked perfectly! Thank you, I KNEW it had to be possible.

On Jun 23, 9:57 pm, Andy Matthews <[EMAIL PROTECTED]> wrote:
> tb_show? I'll give that a shot Su. Thank you for the suggestion.
>
> On Jun 23, 9:52 pm, Su <[EMAIL PROTECTED]> wrote:
>
>
>
> > I think all you'd need to do is launch tb_show and pass it the appropriate
> > parameters(just view the TB source for this). I'm just not sure what event
> > you would use on the dropdown. onchange, maybe?
>
> > On 6/23/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> > > I'd like to trigger thickbox from a select box. I've got a list of
> > > images that a user can select from. When they choose one from the
> > > list, I'd like that image to show using the thicbox method.
>
> > > I can write the rest of the I'm sure but I don't even know:
>
> > > a) If it's possible
> > > b) what the syntax for this might be
>
> > > If you've know how to do this, can you chime in please?- Hide quoted text 
> > > -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -



[jQuery] Re: Triggering thickbox from a select dropdown

2007-06-23 Thread Andy Matthews

tb_show? I'll give that a shot Su. Thank you for the suggestion.

On Jun 23, 9:52 pm, Su <[EMAIL PROTECTED]> wrote:
> I think all you'd need to do is launch tb_show and pass it the appropriate
> parameters(just view the TB source for this). I'm just not sure what event
> you would use on the dropdown. onchange, maybe?
>
> On 6/23/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I'd like to trigger thickbox from a select box. I've got a list of
> > images that a user can select from. When they choose one from the
> > list, I'd like that image to show using the thicbox method.
>
> > I can write the rest of the I'm sure but I don't even know:
>
> > a) If it's possible
> > b) what the syntax for this might be
>
> > If you've know how to do this, can you chime in please?- Hide quoted text -
>
> - Show quoted text -



[jQuery] Re: Triggering thickbox from a select dropdown

2007-06-23 Thread Su

I think all you'd need to do is launch tb_show and pass it the appropriate
parameters(just view the TB source for this). I'm just not sure what event
you would use on the dropdown. onchange, maybe?

On 6/23/07, Andy Matthews <[EMAIL PROTECTED]> wrote:



I'd like to trigger thickbox from a select box. I've got a list of
images that a user can select from. When they choose one from the
list, I'd like that image to show using the thicbox method.

I can write the rest of the I'm sure but I don't even know:

a) If it's possible
b) what the syntax for this might be

If you've know how to do this, can you chime in please?




[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Su

This is neat.

On 6/23/07, Sean Catchpole <[EMAIL PROTECTED]> wrote:


The feature I'm wondering about, is if the zoom2 image should inherit
the classes of the original image. (If what I'm saying makes no sense,
go view the source code of the zoomi page above)



Would it be a pain to make it optional? I ran into this decision when
working on my figures plugin[1], and ended up deciding that whether it was
needed or not was really going to depend upon the user and how their styling
was worked out.

I do have one fairly big objection, though: Your usage of the alt attribute
for the zoomed image is inappropriate and interferes with accessibility.
Using a filename for alt text is considered unacceptable, not to mention
that since you're having it refer to /another/ image, it's just plain wrong.
Why not have Zoomi just look for something like original-filename_zoomed.ext
or something? It would actually cut down on work for the user, for that
matter.


[1] http://pioindustries.com/projects/jquery/figures  --See the "strip"
argument.


[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Daemach

Here's an even better way :)

str+="border-top-style: " + $(this).css("borderTopStyle") + "";


On Jun 23, 2:33 pm, "Sean Catchpole" <[EMAIL PROTECTED]> wrote:
> Another weekend, another plugin =P
>
> zoomi:http://www.sunsean.com/zoomi/
>
> So here's the scoop. It's almost ready, beta as some people call it.
> I'm releasing as beta because I want your input on a feature... and
> there is still one more bug.
>
> The feature I'm wondering about, is if the zoom2 image should inherit
> the classes of the original image. (If what I'm saying makes no sense,
> go view the source code of the zoomi page above)
>
> The only bug is that if there is a border around the zoom2 image using
> css, then it won't be in the right spot. I've run into a interesting
> problem, I can't get the styles from the css file. Check out the
> example of this problem here:http://www.sunsean.com/styletest/If
> anyone knows the answer please let me know.
>
> Enjoy ^_^
>
> ~Sean



[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Daemach

Erg - I hit send too soon...

If you look at document.styleSheets[0].cssRule[4].style.borderTop in
the Firebug DOM tab, it looks like it should be returning a value for
that attribute.  I can't tell you why it doesn't at the moment, but if
you query borderTopWidth, borderTopColor, or borderTopStyle they
return the correct values.


  $(function(){
$(".box").each(function(){
  var str ="width: " + getComputedStyle(this,"width") + "";
  str+="margin-top: " + getComputedStyle(this,"marginTop") + "";
  str+="border-top: " + getComputedStyle(this,"borderTopWidth") +
"";
  str+="border-top: " + getComputedStyle(this,"borderTopColor") +
"";
  str+="border-top: " + getComputedStyle(this,"borderTopStyle") +
"";
  $(this).html(str);
});
  });



On Jun 23, 2:33 pm, "Sean Catchpole" <[EMAIL PROTECTED]> wrote:
> Another weekend, another plugin =P
>
> zoomi:http://www.sunsean.com/zoomi/
>
> So here's the scoop. It's almost ready, beta as some people call it.
> I'm releasing as beta because I want your input on a feature... and
> there is still one more bug.
>
> The feature I'm wondering about, is if the zoom2 image should inherit
> the classes of the original image. (If what I'm saying makes no sense,
> go view the source code of the zoomi page above)
>
> The only bug is that if there is a border around the zoom2 image using
> css, then it won't be in the right spot. I've run into a interesting
> problem, I can't get the styles from the css file. Check out the
> example of this problem here:http://www.sunsean.com/styletest/If
> anyone knows the answer please let me know.
>
> Enjoy ^_^
>
> ~Sean



[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Daemach

Very nice work Sean - that is going to be really useful.

I haven't looked into the border issue you mentioned, but this.width
or this.style.width hold the value of the style="" attribute of the
element.  When your node's styles are inherited via a css rule you
need to look for the computed style.  When I get some time I'm going
to redo my css helper library and release it, but this snippet will
get you going:

camelCase: function(s){
if (s == "float"){ return "cssFloat"; };
for(var str=/-([a-z])/; str.test(s); 
s=s.replace(str,RegExp.
$1.toUpperCase()));
return s;
},
getComputedStyle: function(ele,attr){
attr = this.camelCase(attr);
if (ele.currentStyle){
return ele.currentStyle[attr];
} else if (window.getComputedStyle){
return window.getComputedStyle(ele,null)[attr];
}
return null;
}

On Jun 23, 2:33 pm, "Sean Catchpole" <[EMAIL PROTECTED]> wrote:
> Another weekend, another plugin =P
>
> zoomi:http://www.sunsean.com/zoomi/
>
> So here's the scoop. It's almost ready, beta as some people call it.
> I'm releasing as beta because I want your input on a feature... and
> there is still one more bug.
>
> The feature I'm wondering about, is if the zoom2 image should inherit
> the classes of the original image. (If what I'm saying makes no sense,
> go view the source code of the zoomi page above)
>
> The only bug is that if there is a border around the zoom2 image using
> css, then it won't be in the right spot. I've run into a interesting
> problem, I can't get the styles from the css file. Check out the
> example of this problem here:http://www.sunsean.com/styletest/If
> anyone knows the answer please let me know.
>
> Enjoy ^_^
>
> ~Sean



[jQuery] Triggering thickbox from a select dropdown

2007-06-23 Thread Andy Matthews

I'd like to trigger thickbox from a select box. I've got a list of
images that a user can select from. When they choose one from the
list, I'd like that image to show using the thicbox method.

I can write the rest of the I'm sure but I don't even know:

a) If it's possible
b) what the syntax for this might be

If you've know how to do this, can you chime in please?



[jQuery] Re: .get, callback function and scope. Is this possible?

2007-06-23 Thread Andy Matthews

Mike...

The reason I was moving in that direction was that I needed the
results of the $,get call immediately after it ran. I was using in
conjunction with jEditable as a function call and I had to return the
string that $.get got back from the server to jEditable.

Sadly, I'm going to have to put that portion of the project on hold as
I don't want to spend my budget on interface tweaks when the rest of
the project doesn't even work.

On Jun 23, 9:18 am, Rey Bango <[EMAIL PROTECTED]> wrote:
> No offense taken Mike. Andy and I were pounding our heads trying to
> figure out why the value wasn't appearing so by using the synchronous
> call, I was able to figure out that the variable outside of the $.get()
> callback was indeed being filled.
>
> You're right, though, that a synchronous call should be a last resort.
>
> Rey
>
>
>
>
>
> Michael Geary wrote:
> > Rey, no offense, bud, but synchronous ajax is a last resort. It freezes the
> > browser while the ajax data is loaded.  You don't want to use it unless
> > you're certain that it's necessary - and that is rare.
>
> > Andy, the real question is what you want to do. Scope is not a problem: You
> > can easily assign to a variable in an outer scope:
>
> >   var saveResult;
> >   $.get("ajax.cfm",function(result){
> >   saveResult = result;
> >   });
>
> > But you can't access saveResult immediately after $.get() returns as in your
> > example. After ajax.cfm is loaded and the callback runs, then saveResult is
> > available to any of your other code.
>
> > If you *must* be able to write code that works exactly like your example:
>
> >   $.get("ajax.cfm",function(result){
> >   // callback body
> >   });
> >   alert(result);
>
> > then synchronous ajax is the only way to do it. But freezing the browser
> > while the ajax call runs is something to avoid.
>
> > What is the actual goal you want to accomplish? Or were you just curious why
> > your example didn't work as you expected?
>
> > -Mike
>
> >> From: Rey Bango
>
> >> Hey Andy,
>
> >> I found out what's happening. You are in fact updating the var but
> >> $.get() being an async method, will take longer to complete
> >> than the rest of the JS script. Here's a small example:
>
> >> 
> >> $(document).ready(function() {
>
> >>foo = 'test 1';
>
> >>$.get("module.cfm", function(result){
> >> foo = 'Test 2';
> >>});
>
> >>alert( foo );
> >>   });
>
> >> 
>
> >> Go
>
> >> You'll see that when you run this, the first alert box will
> >> come up saying "Test 1". Thats because $.get is processing
> >> the request asynchronously. When you click on the link,
> >> you'll then see that the value of foo has changed to 'Test 2'.
>
> >> Your best bet is to use this code:
>
> >> foo = 'test 1';
>
> >> $.ajax({
> >> url: "module.cfm",
> >> async: false,
> >> success: function(msg){
> >>foo = 'Test 2';
> >>   }
> >> });
>
> >> alert( foo );
>
> >> $.ajax() lets you define where to make the call synchronous
> >> and asynchronous.
>
> >> I told you I'd figure it out!! :)
>
> >> HTH.
>
> >> Rey././
>
> >> Andy Matthews wrote:
> >>> I'm receiving a string of text back in a .get call:
>
> >>> I can alert the "result" variable while within the callback
> >> portion of
> >>> the .get call.
> >>> $.get("ajax.cfm",function(result){
> >>>// callback body
> >>>alert(result);
> >>> });
>
> >>> But I'd like to somehow be able to get that result variable outside
> >>> the callback like so:
>
> >>> $.get("ajax.cfm",function(result){
> >>>// callback body
> >>> });
> >>> alert(result);
>
> >>> But it doesn't seem to be working. Surely .get has to be able to
> >>> interact with scope outside of itself. Am I missing something?
>
> --
> BrightLight Development, LLC.
> 954-775- (o)
> 954-600-2726 (c)
> [EMAIL PROTECTED]://www.iambright.com- Hide quoted text -
>
> - Show quoted text -



[jQuery] Re: Loosing access to 'this' objects in callback method!

2007-06-23 Thread Nate Cavanaugh


Hi Glenn,
Keeping scope is definitely one of the more frustrating aspects of
Javascript sometimes.

What's happening is that you're running the ajax call, and the complete
method is a method of the object that you're passing into the ajax handler.

So this now points to the object containing the properties you sent in.

To do this so that your member method (the this.parseXML) retains the proper
scope, you can use a closure. I also like to always start off my methods
with a var declaration pointing to the instance this (so I always know when
I am pointing to the instance, and when I use this, that I am pointing to an
element, such as in an event call back):

var instance = this;

$.ajax(
{
type: "POST", // type of http request
url: this.sourceURL, // where to get file from
dataType: "xml", // type of file to retrieve
complete: function(){
instance.parseXML();
}
}
);

Now your parseXML method will run in the proper scope.

I hope that helps :)


knnelg wrote:
> 
> 
> Hi,  I'm another newbie to jQuery and also not that experienced in
> JavaScript so I'm not sure if my issue is jQuery or JavaScript.
> 
> The issue is that I'm creating a constructor for an object, in which I
> initialise some instance properties, then kick off an asynchronous
> $.ajax event to retrieve an XML file.  The callback method of
> the .ajax object is bound to a prototype method of the same object as
> the constructor.
> 
> My problem is that when the ajax call is complete and the callback
> method is called, it appears that the callback method cannot see any
> of the 'this'.properties that were initialized in the constructor.
> 
> I'm beginning to think that the asynchronous nature of the ajax object
> has actually created a new instance of my object in which no
> constructor was called and therefore is not working against the
> original instance I created.  But then again I always look for the
> most obscure explanation instead of noticing the simple error I've
> made.
> 
> I've included the code below.  If anyone can show me the errors of my
> ways, I'd be very grateful.
> 
> The line causing me a problem is commented with // THIS LINE FAILS
> WITH AN "this.woffers has no properties" ERROR
> 
> 
> // Use jQuery 'document.ready' selector to define the function to call
> when page is ready.
> $(main);
> 
> //
> // The main entry function hopefully called by the jQuery 'ready'
> selector
> //
> function main() {
> 
>   try {
>   //create a new 'Woffers' instance
>   var woffers = new Woffers("woffersdata.xml", "xml");
>   }
> 
>   // Catch any exceptions...
>   catch(e) {
> 
>   // ...and report them.  TODO: remove this for live
>   alert(e);
> 
>   }
> 
> }
> 
> //
> // Constructor for a 'Woffers' class which will contain all our
> 'Woffer' items
> // and some methods to retrieve them.
> //
> // Expects:
> //sourceURL - a String containing the location of the file containing
> the
> //data to be used to construct our object.
> //sourceType - a String containing the type of file we are using to
> //construct the object.  Can be "xml" or "json"
> //
> function Woffers(sourceURL, sourceType) {
>   if(sourceType != "xml") {
>   throw new Error("Invalid source type (" + sourceType + ") 
> supplied
> to Woffers constructor.");
>   }
> 
>   // Store parameters for later use by any method
>   this.sourceURL = sourceURL;
>   this.sourceType = sourceType;
> 
>   // Create a property to hold a list of Woffer objects
>   this.woffers = new Array(); // <-- This property should get populated
> by the $.ajax callback method
> 
>   switch(this.sourceType) {
>   case "xml": {
>   $.ajax(
>   {
>   type: "POST", // type of http request
>   url: this.sourceURL, // where to get 
> file from
>   dataType: "xml", // type of file to 
> retrieve
>   complete: this.parseXML // Function to 
> run on completion which
> will populate this.woffers
>   }
>   )
> 
>   break;
> 
>   } // End case(xml)
> 
>   case "json": {
>   $.ajax(
>   {
>   type: "POST", // type of http request
>   url: this.sourceURL, // where to get 
> file from
> 

[jQuery] Moving Images as objects

2007-06-23 Thread Paolo

Hello,

I have 2 images and 1 button. When I click on the button, I'd like to
move image 2 on top of image 2. I know there are some ways of doing
this, but they all require the image coordinates. Is there a way to do
this at the object level as i don't have coordinates?

thanks,
Paolo



[jQuery] Re: Moving Images as objects

2007-06-23 Thread Nate Cavanaugh


Hi Paulo,
What you're trying to do is more than likely not possible, unless I am
misunderstanding.

Are you trying to stack the images? If so, you could do this by setting the
object's z-index to a value higher than the other.

If you're trying to move image 1 to the top location (such as the top right,
top center, or top left), then no, this is impossible.
If this is the case, you're trying to set coordinates that are relative to
other coordinates.

If image 1 is set to the top right of image 2, image 2 must have coordinates
inside of the document, otherwise the coordinates of image 1 could be set to
anywhere on the page.

I think you're trying to do a relative link of objects, but the object does
not have any inherent coordinates until it enters the document flow.

Hopefully I understood what you meant. If not, please let me know more about
what you're trying to do.

Thanks,


Paolo-31 wrote:
> 
> 
> Hello,
> 
> I have 2 images and 1 button. When I click on the button, I'd like to
> move image 2 on top of image 2. I know there are some ways of doing
> this, but they all require the image coordinates. Is there a way to do
> this at the object level as i don't have coordinates?
> 
> thanks,
> Paolo
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Moving-Images-as-objects-tf3970779s15494.html#a11271584
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Moving Images as objects

2007-06-23 Thread Paolo

Hello,

I have 2 images and 1 button. When I click on the button, I'd like to
move image 2 on top of image 2. I know there are some ways of doing
this, but they all require the image coordinates. Is there a way to do
this at the object level as i don't have coordinates?

thanks,
Paolo



[jQuery] Re: Inserting text into TextArea at location

2007-06-23 Thread variaas

to all...I'm using a function written by Alex King, and adapted it to
a function in jQuery:

/**
 * Insert content at caret position (converted to jquery function)
 * @link 
http://alexking.org/blog/2003/06/02/inserting-at-the-cursor-using-javascript
 */
$.fn.insertAtCaret = function (myValue) {
return this.each(function(){
//IE support
if (document.selection) {
this.focus();
sel = document.selection.createRange();
sel.text = myValue;
this.focus();
}
//MOZILLA/NETSCAPE support
else if (this.selectionStart || this.selectionStart == '0') {
var startPos = this.selectionStart;
var endPos = this.selectionEnd;
var scrollTop = this.scrollTop;
this.value = this.value.substring(0, startPos)
  + myValue
  + this.value.substring(endPos,
this.value.length);
this.focus();
this.selectionStart = startPos + myValue.length;
this.selectionEnd = startPos + myValue.length;
this.scrollTop = scrollTop;
} else {
this.value += myValue;
this.focus();
}
});

};

On Jun 22, 10:46 am, variaas <[EMAIL PROTECTED]> wrote:
> How do I insert a string at a specific place in a textarea? I want to
> insert the string where ever the keyboard cursor is.



[jQuery] Re: jQuery for GreaseMonkey

2007-06-23 Thread Sean Catchpole


Ahoy,

Seems like a had a little time, so here's the script:
http://userscripts.org/scripts/show/10141

Cheers

~Sean


[jQuery] Re: Ajax validation preview

2007-06-23 Thread Felix Geisendörfer




Excellent work Jörn. Thanks a lot.

-- Felix
--
My latest blog posts:

  
 My Business: http://www.fg-webdesign.de





Web Specialist wrote:
Congratulatiosn Jorn. Once more. Your ajax validation
option is very very goog approach! I'll try your 1.2 version and send
feedback.
  
Cheers
  
  2007/6/23, Jörn Zaefferer <
[EMAIL PROTECTED]>:
  
Hi folks,

for anyone using the validation plugin or interested to use it once
ajax

validation is available I'd like to present a preview of the next
validation feature upcoming in 1.2:
http://jquery.bassistance.de/ajax-validation/demo-test/milk/


To try it out: Enter something as a username. These are the rules used
for the field:

username: {
required: true,
minLength: 2,
remote: "users.php"
},

In other words, you can stick with the declarative style to specify
validation rules as for all local validation.

Currently the scripts ("users.php") simply returns true for valid and
false for invalid values. This works in this case, but I can imagine

endless possibilites that need a more complex protocol. Therefore, as
always, I appreciate your feedback. Just let me know about your usecases
of ajax validation.

If you'd like to play around with the current code, its in jQuery's

subversion repository: http://dev.jquery.com/browser/trunk/plugins/validate/
Also available as a zip-file:
http://dev.jquery.com/changeset/2146/trunk/plugins/validate?old_path=%2F&format=zip

--
Jörn Zaefferer

http://bassistance.de

  
  
  





[jQuery] Loosing access to 'this' objects in callback method!

2007-06-23 Thread knnelg

Hi,  I'm another newbie to jQuery and also not that experienced in
JavaScript so I'm not sure if my issue is jQuery or JavaScript.

The issue is that I'm creating a constructor for an object, in which I
initialise some instance properties, then kick off an asynchronous
$.ajax event to retrieve an XML file.  The callback method of
the .ajax object is bound to a prototype method of the same object as
the constructor.

My problem is that when the ajax call is complete and the callback
method is called, it appears that the callback method cannot see any
of the 'this'.properties that were initialized in the constructor.

I'm beginning to think that the asynchronous nature of the ajax object
has actually created a new instance of my object in which no
constructor was called and therefore is not working against the
original instance I created.  But then again I always look for the
most obscure explanation instead of noticing the simple error I've
made.

I've included the code below.  If anyone can show me the errors of my
ways, I'd be very grateful.

The line causing me a problem is commented with // THIS LINE FAILS
WITH AN "this.woffers has no properties" ERROR


// Use jQuery 'document.ready' selector to define the function to call
when page is ready.
$(main);

//
// The main entry function hopefully called by the jQuery 'ready'
selector
//
function main() {

try {
//create a new 'Woffers' instance
var woffers = new Woffers("woffersdata.xml", "xml");
}

// Catch any exceptions...
catch(e) {

// ...and report them.  TODO: remove this for live
alert(e);

}

}

//
// Constructor for a 'Woffers' class which will contain all our
'Woffer' items
// and some methods to retrieve them.
//
// Expects:
//  sourceURL - a String containing the location of the file containing
the
//  data to be used to construct our object.
//  sourceType - a String containing the type of file we are using to
//  construct the object.  Can be "xml" or "json"
//
function Woffers(sourceURL, sourceType) {
if(sourceType != "xml") {
throw new Error("Invalid source type (" + sourceType + ") 
supplied
to Woffers constructor.");
}

// Store parameters for later use by any method
this.sourceURL = sourceURL;
this.sourceType = sourceType;

// Create a property to hold a list of Woffer objects
this.woffers = new Array(); // <-- This property should get populated
by the $.ajax callback method

switch(this.sourceType) {
case "xml": {
$.ajax(
{
type: "POST", // type of http request
url: this.sourceURL, // where to get 
file from
dataType: "xml", // type of file to 
retrieve
complete: this.parseXML // Function to 
run on completion which
will populate this.woffers
}
)

break;

} // End case(xml)

case "json": {
$.ajax(
{
type: "POST", // type of http request
url: this.sourceURL, // where to get 
file from
dataType: "json", // type of file to 
retrieve
complete: this.parseJson // Function to 
run on completion
}
)

break;

} // End case(json)
}

} // End Woffers constructor

//
//
//
Woffers.prototype.parseXML = function(woffersDOM, resultStatus) {
if(resultStatus != "success") {
throw new Error("Encountered a problem retreiving the XML 
file." +
" Reported status is " + 
ResultStatus + ".");
}
// retrieve a list of woffers from the response
var retrievedWoffers =
woffersDOM.responseXML.documentElement.getElementsByTagName("route");

// Go through each woffer and use it to create a new 'Woffer' object
for(var index = 0; index < retrievedWoffers.length; ++index) {

//

[jQuery] Re: Ajax validation preview

2007-06-23 Thread Web Specialist

Congratulatiosn Jorn. Once more. Your ajax validation option is very very
goog approach! I'll try your 1.2 version and send feedback.

Cheers

2007/6/23, Jörn Zaefferer <[EMAIL PROTECTED]>:



Hi folks,

for anyone using the validation plugin or interested to use it once ajax
validation is available I'd like to present a preview of the next
validation feature upcoming in 1.2:
http://jquery.bassistance.de/ajax-validation/demo-test/milk/

To try it out: Enter something as a username. These are the rules used
for the field:

username: {
required: true,
minLength: 2,
remote: "users.php"
},

In other words, you can stick with the declarative style to specify
validation rules as for all local validation.

Currently the scripts ("users.php") simply returns true for valid and
false for invalid values. This works in this case, but I can imagine
endless possibilites that need a more complex protocol. Therefore, as
always, I appreciate your feedback. Just let me know about your usecases
of ajax validation.

If you'd like to play around with the current code, its in jQuery's
subversion repository:
http://dev.jquery.com/browser/trunk/plugins/validate/
Also available as a zip-file:

http://dev.jquery.com/changeset/2146/trunk/plugins/validate?old_path=%2F&format=zip

--
Jörn Zaefferer

http://bassistance.de




[jQuery] ANNOUNCE: zoomi plugin!

2007-06-23 Thread Sean Catchpole


Another weekend, another plugin =P

zoomi: http://www.sunsean.com/zoomi/

So here's the scoop. It's almost ready, beta as some people call it.
I'm releasing as beta because I want your input on a feature... and
there is still one more bug.

The feature I'm wondering about, is if the zoom2 image should inherit
the classes of the original image. (If what I'm saying makes no sense,
go view the source code of the zoomi page above)

The only bug is that if there is a border around the zoom2 image using
css, then it won't be in the right spot. I've run into a interesting
problem, I can't get the styles from the css file. Check out the
example of this problem here: http://www.sunsean.com/styletest/ If
anyone knows the answer please let me know.

Enjoy ^_^

~Sean


[jQuery] Re: displaying an offscreen row

2007-06-23 Thread Ⓙⓐⓚⓔ

Klaus, do you know which browsers scrollIntoView works with?

On 6/23/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:



Phil Glatz wrote:
> I have a table inside a div; the div has a fixed height and overflow set
> to scroll. When the page is opened, the row containing the last selected
> data is highlighted, via jquery/DOM.
>
> the problem I have is that if the list (number of rows in the table) is
> bigger than can fit in the div, and the current element is below the
> visible area, you have to scroll down to see it.
>
> Is there a way to make the div scroll up to make the row I want to see
> visible, using DOM?
>
> I don't think so, but thought I'd ask. Do any of the add-ons for jquery
> that deal with tables handle this?
>


Try the scrollIntoView method:

$('tr')[0].scrollIntoView();


http://developer.mozilla.org/en/docs/DOM:element.scrollIntoView


--Klaus





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: displaying an offscreen row

2007-06-23 Thread Klaus Hartl


Phil Glatz wrote:
I have a table inside a div; the div has a fixed height and overflow set 
to scroll. When the page is opened, the row containing the last selected 
data is highlighted, via jquery/DOM.


the problem I have is that if the list (number of rows in the table) is 
bigger than can fit in the div, and the current element is below the 
visible area, you have to scroll down to see it.


Is there a way to make the div scroll up to make the row I want to see 
visible, using DOM?


I don't think so, but thought I'd ask. Do any of the add-ons for jquery 
that deal with tables handle this?





Try the scrollIntoView method:

$('tr')[0].scrollIntoView();


http://developer.mozilla.org/en/docs/DOM:element.scrollIntoView


--Klaus


[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Ⓙⓐⓚⓔ

I take it all back!
   
   $(function(){
   eval($('body').attr('onload'));
   });
   
   
   
   ok
   

alerted 2 times!!

On 6/23/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:


yes... it overrides onload="test()" ... but it should still be in the dom,
so you can still get at it!

// untested

jQuery(document).ready(function() {

eval($('body').attr('onload'));

})



On 6/23/07, howa <[EMAIL PROTECTED]> wrote:
>
>
> Thanks...but how to handle this?
>
>
> 
> 
>
> 
>
> 
> jQuery(document).ready(function() {
> // Assign event to window.onload
> jQuery(window).load(function() {
> alert('Everything is loaded!');
> });
> });
>
> function test() {
> alert('test');
> }
>
> 
>
> 
> 
> TEST123
> 
> 
>
> I don't want to override the original onload: test()
>
> also...
>
> why jQuery(body) or jQuery("body") didn't work?
>
> thanks.
>
> On 6月23日, 下午9時31分, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> > Hi Howa,
> >
> > Try jQuery(window) without the quotes around window. That should do
> > it! :)
> >
> > --Karl
> > _
> > Karl Swedbergwww.englishrules.comwww.learningjquery.com
> >
> > On Jun 23, 2007, at 9:20 AM, howa wrote:
> >
> >
> >
> >
> >
> > > Hello Gilles & Erik, the codes below never work with IE7 & FF2.0
> >
> > > 
> > > 
> >
> > > 
> >
> > > 
> > > jQuery(document).ready(function() {
> > >alert('ready');
> >
> > > // Assign event to window.onload
> > > jQuery('window').load(function() {
> > > alert('Everything is loaded!');
> > > });
> >
> > > });
> >
> > > 
> >
> > > 
> > > 
> > > TEST123
> > > 
> > > 
> >
> > > howa
> >
> > > On 6月23日, 下午7時09分, "Gilles (Webunity)" < [EMAIL PROTECTED]>
> > > wrote:
> > >> As i see your question, i think you mean this:
> >
> > >> jQuery(document).ready(function() {
> > >> // Assign event to window.onload
> > >> jQuery('body').load(function() {
> > >> alert('Everything is loaded!');
> > >> });
> >
> > >> });
> >
> > >> On 23 jun, 12:52, howa < [EMAIL PROTECTED]> wrote:
> >
> > >>> Hello,
> >
> > >>> is it possible to attach some codes to the body.onload via
> > >>> document.ready , or other methods to attach body.onload?
> >
> > >>> thanks.- 隱藏被引用文字 -
> >
> > - 顯示被引用文字 -
>
>


--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] displaying an offscreen row

2007-06-23 Thread Phil Glatz
I have a table inside a div; the div has a fixed height and overflow set to
scroll. When the page is opened, the row containing the last selected data
is highlighted, via jquery/DOM.

the problem I have is that if the list (number of rows in the table) is
bigger than can fit in the div, and the current element is below the visible
area, you have to scroll down to see it.

Is there a way to make the div scroll up to make the row I want to see
visible, using DOM?

I don't think so, but thought I'd ask. Do any of the add-ons for jquery that
deal with tables handle this?


[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Ⓙⓐⓚⓔ

yes... it overrides onload="test()" ... but it should still be in the dom,
so you can still get at it!

// untested

jQuery(document).ready(function() {

eval($('body').attr('onload'));

})



On 6/23/07, howa <[EMAIL PROTECTED]> wrote:



Thanks...but how to handle this?








jQuery(document).ready(function() {
// Assign event to window.onload
jQuery(window).load(function() {
alert('Everything is loaded!');
});
});

function test() {
alert('test');
}





TEST123



I don't want to override the original onload: test()

also...

why jQuery(body) or jQuery("body") didn't work?

thanks.

On 6月23日, 下午9時31分, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Howa,
>
> Try jQuery(window) without the quotes around window. That should do
> it! :)
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Jun 23, 2007, at 9:20 AM, howa wrote:
>
>
>
>
>
> > Hello Gilles & Erik, the codes below never work with IE7 & FF2.0
>
> > 
> > 
>
> > 
>
> > 
> > jQuery(document).ready(function() {
> >alert('ready');
>
> > // Assign event to window.onload
> > jQuery('window').load(function() {
> > alert('Everything is loaded!');
> > });
>
> > });
>
> > 
>
> > 
> > 
> > TEST123
> > 
> > 
>
> > howa
>
> > On 6月23日, 下午7時09分, "Gilles (Webunity)" <[EMAIL PROTECTED]>
> > wrote:
> >> As i see your question, i think you mean this:
>
> >> jQuery(document).ready(function() {
> >> // Assign event to window.onload
> >> jQuery('body').load(function() {
> >> alert('Everything is loaded!');
> >> });
>
> >> });
>
> >> On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote:
>
> >>> Hello,
>
> >>> is it possible to attach some codes to the body.onload via
> >>> document.ready, or other methods to attach body.onload?
>
> >>> thanks.- 隱藏被引用文字 -
>
> - 顯示被引用文字 -





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Erik Beeson

Try this:





function test() {
  alert('test');
}

$(document).ready(function() {

});

// Assign event to window.onload
$(window).load(test);



TEST123



--Erik

On 6/23/07, howa <[EMAIL PROTECTED]> wrote:


Thanks...but how to handle this?








jQuery(document).ready(function() {
// Assign event to window.onload
jQuery(window).load(function() {
alert('Everything is loaded!');
});
});

function test() {
alert('test');
}





TEST123



I don't want to override the original onload: test()

also...

why jQuery(body) or jQuery("body") didn't work?

thanks.

On 6月23日, 下午9時31分, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Howa,
>
> Try jQuery(window) without the quotes around window. That should do
> it! :)
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Jun 23, 2007, at 9:20 AM, howa wrote:
>
>
>
>
>
> > Hello Gilles & Erik, the codes below never work with IE7 & FF2.0
>
> > 
> > 
>
> > 
>
> > 
> > jQuery(document).ready(function() {
> >alert('ready');
>
> > // Assign event to window.onload
> > jQuery('window').load(function() {
> > alert('Everything is loaded!');
> > });
>
> > });
>
> > 
>
> > 
> > 
> > TEST123
> > 
> > 
>
> > howa
>
> > On 6月23日, 下午7時09分, "Gilles (Webunity)" <[EMAIL PROTECTED]>
> > wrote:
> >> As i see your question, i think you mean this:
>
> >> jQuery(document).ready(function() {
> >> // Assign event to window.onload
> >> jQuery('body').load(function() {
> >> alert('Everything is loaded!');
> >> });
>
> >> });
>
> >> On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote:
>
> >>> Hello,
>
> >>> is it possible to attach some codes to the body.onload via
> >>> document.ready, or other methods to attach body.onload?
>
> >>> thanks.- 隱藏被引用文字 -
>
> - 顯示被引用文字 -




[jQuery] Re: jQuery for GreaseMonkey

2007-06-23 Thread Sean Catchpole


Hey Michael,

If you code is inside of the usual $(function(){...}) then it will not exectute.
I have not changed over v1.1.2 to Greasemonkey, but if I get time
today I will do so.

~Sean


[jQuery] Re: ANNOUCE: slideView plugin released

2007-06-23 Thread Rey Bango


Great work GianCarlo! Another cool feature would be to distinguish the 
number that a person clicked on. It could be as easy as changing the 
color. That way, when I click on #6, it displays the #6 box uniquely.


Rey

GianCarlo Mingati wrote:

Hi,

http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html

the plugin it's ready with some new pictures and a bt of
'documentation'
I suggest to use it with small galleris in a post until i've fixed the
'preload' with iE7.

GC

On Jun 21, 5:42 pm, Rey Bango <[EMAIL PROTECTED]> wrote:

Ok. Its working now. The image stacking issue I reported earlier is
there but the slider now renders correctly.

In terms of the images displaying first, I'm wondering if you could
initially place the images within a hidden div and then load them into
the slider. There was also discussion on here about preloading images. I
wonder if that might help.

Rey...



GianCarloMingati wrote:

Rey, r u sure??
Hit F5.
GC
On Jun 21, 5:03 pm, Rey Bango <[EMAIL PROTECTED]> wrote:

Its not working any longer. When I hit the page, it just displays all of
the images. I don't see any JS errors being reported.
Rey
GianCarloMingati wrote:

Hi it is something i noticed too but i don't know how to fix.
IE7 and FF/Opera have different ways to behave on DOM ready AND
document LOAD.
i don't know how to fix it.
GC
anybody?
On Jun 21, 4:26 pm, Rey Bango <[EMAIL PROTECTED]> wrote:

Something that caught my eye when testing it in IE7 is that all of the
images initially appear sequentially on the page and then the page gets
reformatted into the SlideViewer. Its hard to explain it but I've taken
a screen cap of it and attached it to this email. FireFox works fine.
Rey...
GianCarloMingati wrote:

Hi all.
After a bit of trials i ended up with this plugin.
http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/i...
Basically it is possible, into any page (blog), to insert an unordered
List of images inside a DIV such as

   
   
   
   

   

and slideView  will add another list for commanding the image slide.
pretty easy and lightweight.
Note: I am a total newbye so this is my very first plugin!
Enjoy!
GC

--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]://www.iambright.com
 slideview.jpg
45KViewDownload

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

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





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


[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread howa

Thanks...but how to handle this?








jQuery(document).ready(function() {
// Assign event to window.onload
jQuery(window).load(function() {
alert('Everything is loaded!');
});
});

function test() {
alert('test');
}





TEST123



I don't want to override the original onload: test()

also...

why jQuery(body) or jQuery("body") didn't work?

thanks.

On 6月23日, 下午9時31分, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Howa,
>
> Try jQuery(window) without the quotes around window. That should do  
> it! :)
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Jun 23, 2007, at 9:20 AM, howa wrote:
>
>
>
>
>
> > Hello Gilles & Erik, the codes below never work with IE7 & FF2.0
>
> > 
> > 
>
> > 
>
> > 
> > jQuery(document).ready(function() {
> >alert('ready');
>
> > // Assign event to window.onload
> > jQuery('window').load(function() {
> > alert('Everything is loaded!');
> > });
>
> > });
>
> > 
>
> > 
> > 
> > TEST123
> > 
> > 
>
> > howa
>
> > On 6月23日, 下午7時09分, "Gilles (Webunity)" <[EMAIL PROTECTED]>  
> > wrote:
> >> As i see your question, i think you mean this:
>
> >> jQuery(document).ready(function() {
> >> // Assign event to window.onload
> >> jQuery('body').load(function() {
> >> alert('Everything is loaded!');
> >> });
>
> >> });
>
> >> On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote:
>
> >>> Hello,
>
> >>> is it possible to attach some codes to the body.onload via
> >>> document.ready, or other methods to attach body.onload?
>
> >>> thanks.- 隱藏被引用文字 -
>
> - 顯示被引用文字 -



[jQuery] Re: ANNOUCE: slideView plugin released

2007-06-23 Thread GianCarlo Mingati

Hi,

http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html

the plugin it's ready with some new pictures and a bt of
'documentation'
I suggest to use it with small galleris in a post until i've fixed the
'preload' with iE7.

GC

On Jun 21, 5:42 pm, Rey Bango <[EMAIL PROTECTED]> wrote:
> Ok. Its working now. The image stacking issue I reported earlier is
> there but the slider now renders correctly.
>
> In terms of the images displaying first, I'm wondering if you could
> initially place the images within a hidden div and then load them into
> the slider. There was also discussion on here about preloading images. I
> wonder if that might help.
>
> Rey...
>
>
>
> GianCarloMingati wrote:
> > Rey, r u sure??
> > Hit F5.
> > GC
>
> > On Jun 21, 5:03 pm, Rey Bango <[EMAIL PROTECTED]> wrote:
> >> Its not working any longer. When I hit the page, it just displays all of
> >> the images. I don't see any JS errors being reported.
>
> >> Rey
>
> >>GianCarloMingati wrote:
> >>> Hi it is something i noticed too but i don't know how to fix.
> >>> IE7 and FF/Opera have different ways to behave on DOM ready AND
> >>> document LOAD.
> >>> i don't know how to fix it.
> >>> GC
> >>> anybody?
> >>> On Jun 21, 4:26 pm, Rey Bango <[EMAIL PROTECTED]> wrote:
>  Something that caught my eye when testing it in IE7 is that all of the
>  images initially appear sequentially on the page and then the page gets
>  reformatted into the SlideViewer. Its hard to explain it but I've taken
>  a screen cap of it and attached it to this email. FireFox works fine.
>  Rey...
> GianCarloMingati wrote:
> > Hi all.
> > After a bit of trials i ended up with this plugin.
> >http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/i...
> > Basically it is possible, into any page (blog), to insert an unordered
> > List of images inside a DIV such as
> > 
> >
> >
> >
> >
> > 
> >
> > 
> > and slideView  will add another list for commanding the image slide.
> > pretty easy and lightweight.
> > Note: I am a total newbye so this is my very first plugin!
> > Enjoy!
> > GC
>  --
>  BrightLight Development, LLC.
>  954-775- (o)
>  954-600-2726 (c)
>  [EMAIL PROTECTED]://www.iambright.com
>   slideview.jpg
>  45KViewDownload
> >> --
> >> BrightLight Development, LLC.
> >> 954-775- (o)
> >> 954-600-2726 (c)
> >> [EMAIL PROTECTED]://www.iambright.com
>
> --
> BrightLight Development, LLC.
> 954-775- (o)
> 954-600-2726 (c)
> [EMAIL PROTECTED]://www.iambright.com



[jQuery] Re: Uploaded file progress status

2007-06-23 Thread Benjamin Sterling

Johny,
There is a plugin: http://www.pixeline.be/experiments/jqUploader/test.php

On 6/23/07, Johny <[EMAIL PROTECTED]> wrote:




Can anyone suggest a solution  how to use jQuery for a script that
will show ,during  uploading file,  information how many bytes have
already been uploaded?

I know about uploading progress bar scripts but such programs are
rather difficult to be understood properly for me.
All that I need is giving a user a  number  showing downloading
progress, in other words, showing how many bytes have already been
uploaded .
Any idea would be appreciated.Thanks.
L





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


[jQuery] jQuery for GreaseMonkey

2007-06-23 Thread Michael Heilemann

So I've got these nice script I've written, that I really want to turn
into GreaseMonkey scripts. The problem is, I want to embed the jQuery
code _in_ my GM script, so that they're easy to distribute, but I
can't get it to work.

I've tried Sean Catchpole's GM script, and maybe I'm missing
something, but regardless of what I do, I cannot execute jQuery code
with it.

If at all possible, I would really like to avoid loading the jQuery
remotely.

So, what to do?



[jQuery] jqUploader

2007-06-23 Thread [EMAIL PROTECTED]




Does anyone use jqUploader?




I use server side script for uploading in Python.It works well  but I would like to add a 
progress bar during uploading.
Is jqUploader the right choice? Or is there an easier way how to add progress during 
uploading?
Thank you
L




[jQuery] Re: Thickbox, JQuery and editInPlace

2007-06-23 Thread [EMAIL PROTECTED]

I am having the same problem.  I use $.(#div).load(something.php)
which then has references to thickbox for modal dialogs or image
galleries.  Everything works perfect in FF & Safari, but doesn't work
just right in IE.  If I access the included files directly (e.g.
www.blah.com/something.php), Thickbox works as expected in IE.  But
when I include them via the JQuery load call, thickbox doesn't work.



[jQuery] Uploaded file progress status

2007-06-23 Thread Johny


Can anyone suggest a solution  how to use jQuery for a script that
will show ,during  uploading file,  information how many bytes have
already been uploaded?

I know about uploading progress bar scripts but such programs are
rather difficult to be understood properly for me.
All that I need is giving a user a  number  showing downloading
progress, in other words, showing how many bytes have already been
uploaded .
Any idea would be appreciated.Thanks.
L



[jQuery] jqUploader

2007-06-23 Thread Johny

Does anyone use jqUploader?


I use server side script for uploading in Python.It works well  but I
would like to add a progress bar during uploading.
Is jqUploader the right choice? Or is there an easier way how to add
progress during  uploading?
Thank you
L



[jQuery] Re: What's your setup?

2007-06-23 Thread Shelane

> What OS?

OS X 10.4.10 (Windows XP for testing only - no dev)

> What IDE or editor?

Dreamweaver CS3, BBEdit

> What backend language, if any (php, asp, cf, ruby, java, etc)?

Lasso

> What framework, if any (cake, symfony, rails, struts, etc)?

None

> Any other significant components (persistence layer, database, etc)?

MySQL database

Server:
OS X 10.4.10 Server, WebSTAR (hopefully switching to Apache soon)



[jQuery] Ajax validation preview

2007-06-23 Thread Jörn Zaefferer


Hi folks,

for anyone using the validation plugin or interested to use it once ajax 
validation is available I'd like to present a preview of the next 
validation feature upcoming in 1.2:

http://jquery.bassistance.de/ajax-validation/demo-test/milk/

To try it out: Enter something as a username. These are the rules used 
for the field:


username: {
required: true,
minLength: 2,
remote: "users.php"
},

In other words, you can stick with the declarative style to specify 
validation rules as for all local validation.


Currently the scripts ("users.php") simply returns true for valid and 
false for invalid values. This works in this case, but I can imagine 
endless possibilites that need a more complex protocol. Therefore, as 
always, I appreciate your feedback. Just let me know about your usecases 
of ajax validation.


If you'd like to play around with the current code, its in jQuery's 
subversion repository: http://dev.jquery.com/browser/trunk/plugins/validate/
Also available as a zip-file: 
http://dev.jquery.com/changeset/2146/trunk/plugins/validate?old_path=%2F&format=zip


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: .get, callback function and scope. Is this possible?

2007-06-23 Thread Rey Bango


No offense taken Mike. Andy and I were pounding our heads trying to 
figure out why the value wasn't appearing so by using the synchronous 
call, I was able to figure out that the variable outside of the $.get() 
callback was indeed being filled.


You're right, though, that a synchronous call should be a last resort.

Rey

Michael Geary wrote:

Rey, no offense, bud, but synchronous ajax is a last resort. It freezes the
browser while the ajax data is loaded.  You don't want to use it unless
you're certain that it's necessary - and that is rare.

Andy, the real question is what you want to do. Scope is not a problem: You
can easily assign to a variable in an outer scope:

  var saveResult;
  $.get("ajax.cfm",function(result){
  saveResult = result;
  }); 


But you can't access saveResult immediately after $.get() returns as in your
example. After ajax.cfm is loaded and the callback runs, then saveResult is
available to any of your other code.
 
If you *must* be able to write code that works exactly like your example:


  $.get("ajax.cfm",function(result){
  // callback body
  });
  alert(result);

then synchronous ajax is the only way to do it. But freezing the browser
while the ajax call runs is something to avoid.

What is the actual goal you want to accomplish? Or were you just curious why
your example didn't work as you expected?

-Mike


From: Rey Bango

Hey Andy,

I found out what's happening. You are in fact updating the var but
$.get() being an async method, will take longer to complete 
than the rest of the JS script. Here's a small example:



$(document).ready(function() {

foo = 'test 1';

$.get("module.cfm", function(result){
foo = 'Test 2';
   });

alert( foo );
  });

 

Go

You'll see that when you run this, the first alert box will 
come up saying "Test 1". Thats because $.get is processing 
the request asynchronously. When you click on the link, 
you'll then see that the value of foo has changed to 'Test 2'.


Your best bet is to use this code:

foo = 'test 1';

$.ajax({
url: "module.cfm",
async: false,
success: function(msg){
foo = 'Test 2';
  }
});

alert( foo );

$.ajax() lets you define where to make the call synchronous 
and asynchronous.


I told you I'd figure it out!! :)

HTH.

Rey././



Andy Matthews wrote:

I'm receiving a string of text back in a .get call:

I can alert the "result" variable while within the callback 
portion of 

the .get call.
$.get("ajax.cfm",function(result){
// callback body
alert(result);
});

But I'd like to somehow be able to get that result variable outside 
the callback like so:


$.get("ajax.cfm",function(result){
// callback body
});
alert(result);

But it doesn't seem to be working. Surely .get has to be able to 
interact with scope outside of itself. Am I missing something?





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


[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Karl Swedberg

Hi Howa,

Try jQuery(window) without the quotes around window. That should do  
it! :)



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



On Jun 23, 2007, at 9:20 AM, howa wrote:



Hello Gilles & Erik, the codes below never work with IE7 & FF2.0









jQuery(document).ready(function() {
alert('ready');

// Assign event to window.onload
jQuery('window').load(function() {
alert('Everything is loaded!');
});

});





TEST123




howa



On 6月23日, 下午7時09分, "Gilles (Webunity)" <[EMAIL PROTECTED]>  
wrote:

As i see your question, i think you mean this:

jQuery(document).ready(function() {
// Assign event to window.onload
jQuery('body').load(function() {
alert('Everything is loaded!');
});

});

On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote:


Hello,



is it possible to attach some codes to the body.onload via
document.ready, or other methods to attach body.onload?



thanks.






[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread howa

Hello Gilles & Erik, the codes below never work with IE7 & FF2.0









jQuery(document).ready(function() {
alert('ready');

// Assign event to window.onload
jQuery('window').load(function() {
alert('Everything is loaded!');
});

});





TEST123




howa



On 6月23日, 下午7時09分, "Gilles (Webunity)" <[EMAIL PROTECTED]> wrote:
> As i see your question, i think you mean this:
>
> jQuery(document).ready(function() {
> // Assign event to window.onload
> jQuery('body').load(function() {
> alert('Everything is loaded!');
> });
>
> });
>
> On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > is it possible to attach some codes to the body.onload via
> > document.ready, or other methods to attach body.onload?
>
> > thanks.



[jQuery] Re: Possible validate plugin bugs.

2007-06-23 Thread Jörn Zaefferer


Ronald wrote:

Hello Jörn and others,

I may have found 2 bugs in the form validation plugin. But this could
also be due to IE6 and IE7, I am not sure.
The first bug shows up when you add a field (hidden field in my case)
with a name="id". I understand that IE doesnt like that a lot since IE
treats names and ids almost the same (or so I recall reading
somewhere). However I dont understand that when I add a field with a
name of id, the form validation does not work anymore and just submits
everything.

Example is at http://www.competities.com/jquery/demo-test/test_with_id.html.
The second form contains the hidden id. Note that this is the complete
zip file of the form plugin.
  
Now that is one of those really weird IE bugs. I've checked your example 
and tried around a bit to see where the problem occurs, but haven't yet 
found anything useful.

The second bug occurs when I add a button with a name of cancel. Again
there is no form validation, not even when I press the submit button.
Also in IE6 there is no alert (nor a validation) whereas in firefox
there is an alert (but no validation).
  
Now that isn't half as weird as the other issue. As long as it occurs in 
Firefox is nearly trivial to fix it. The problem here was some extra 
code that was supossed to skip validation when a submit button with a 
class "cancel" was clicked. My mistake was to assign the result an 
expando named "cancel" to form-element. A check for form.cancel returned 
true when an element with id "cancel" was present, therefore the 
presence of that button caused the validation to skip always.


Thanks for your reports. As they are both easy to work around it should 
be no problem to wait for 1.2, okay? Though I'm not sure I can provide a 
fix for the first issue.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Easebox

2007-06-23 Thread Jörn Zaefferer


Glen Lipka wrote:
I had a little bit of free time, so I started an "easeBox".  Like 
thickbox, but with easing transitions.

http://www.commadot.com/jquery/easebox/#

Cool. I like it already.


I made a list of things I want to do to it on it.
Any suggestions to add to the list?
Any suggestions of how I could improve the code?
I have no idea how to make it into a plugin.

Continuing to work on it, but help is greatly appreciated.

I like to be able to click somewhere in the document to hide any popups.
Navigating between images should be possible using the cursor keys. Any 
other combination (n, p, ",", ";") seems very unintuitive.
Navigation images should be always in the same place, eg. lower right 
corner. Posititiong them relative to the image is extremely annoying 
when navigating between images with different sizes. You can't keep 
clicking but have to target the button again and again.
Presentation wise a greyed out background and think black and white 
borders are very nice. Make it look like a picture frame: Grey 
background, think black border (>30px), thin white border (15-30px).
D&D and resizable seems to be rather useless as long as you can't open 
more then one image at a time. ... Okay, its currently possible with 
your script, but is that really useful?
For the gallery stuff I'd like to have one or more callbacks when the 
user opens and closes and cycles between images. That would make it easy 
to add some neat stuff like sounds of a slide projector.


For making it a plugin: There still is 
http://docs.jquery.com/Plugins/Authoring available. Its not really 
up-to-date but still a good reference. Apart from that you can learn a 
lot by reading other's code.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Gilles (Webunity)

As i see your question, i think you mean this:

jQuery(document).ready(function() {
// Assign event to window.onload
jQuery('body').load(function() {
alert('Everything is loaded!');
});
});

On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote:
> Hello,
>
> is it possible to attach some codes to the body.onload via
> document.ready, or other methods to attach body.onload?
>
> thanks.



[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Erik Beeson


the window.onload event fires when all external dependencies (such as
images) have loaded. You can bind events to it with:

$(window).load(function() {
 alert('Everything is loaded!');
});

Is that what you're looking for?

--Erik


On 6/23/07, howa <[EMAIL PROTECTED]> wrote:


Hello,

is it possible to attach some codes to the body.onload via
document.ready, or other methods to attach body.onload?

thanks.




[jQuery] Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread howa

Hello,

is it possible to attach some codes to the body.onload via
document.ready, or other methods to attach body.onload?

thanks.



[jQuery] Digg Moves to jQuery's JavaScript Library

2007-06-23 Thread joomlafreak

Saw it on Ajax Magazine Posted by Hatem on June 23, 2007 9:04 AM

One more addition to big sites switching to my love jQuery.
Congratulations jQuery community and to the dev team especially. We
all owe you a lot for your hard work.

http://ajax.phpmagazine.net/2007/06/digg_moves_to_jquerys_javascri.html



[jQuery] Possible validate plugin bugs.

2007-06-23 Thread Ronald

Hello Jörn and others,

I may have found 2 bugs in the form validation plugin. But this could
also be due to IE6 and IE7, I am not sure.
The first bug shows up when you add a field (hidden field in my case)
with a name="id". I understand that IE doesnt like that a lot since IE
treats names and ids almost the same (or so I recall reading
somewhere). However I dont understand that when I add a field with a
name of id, the form validation does not work anymore and just submits
everything.

Example is at http://www.competities.com/jquery/demo-test/test_with_id.html.
The second form contains the hidden id. Note that this is the complete
zip file of the form plugin.

The second bug occurs when I add a button with a name of cancel. Again
there is no form validation, not even when I press the submit button.
Also in IE6 there is no alert (nor a validation) whereas in firefox
there is an alert (but no validation).

Example is at 
http://www.competities.com/jquery/demo-test/test_with_cancel_button.html

Other then that I think this is a great plugin. Thx for your time



[jQuery] Re: Simple plugin to rollove an image

2007-06-23 Thread howa

not really...

being vision impaired is not a fault
viewing your site on mobile device which don't understand css or js is
not a fault

you are just loosing your potential visitors, anyway, its up to you

anyway...

what i concern is we are doing web development, not game developement,
don't use sprites - never

:)

On 6月23日, 下午2時10分, "Matt Stith" <[EMAIL PROTECTED]> wrote:
> Honestly when i develop, im not really worried about browsers that dont
> understand css or javascript. If they chose to use an incredibly outdated
> browser, thats their fault.
>
> On 6/23/07, howa <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On 6月23日, 上午2時17分, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
>
> > > I am not sure how it diminishes accessibility.
>
> > What if your browser don't understand css and js?
>
> > for jquery's solution, it is fine, you can still see the original
> > image, but only drop the hover effect
> > for css solutions, you might drop the whole image or only people can
> > see the messy single image
>
> > what's more...
>
> > what is `alt` tag for your single image?
> > how can a blind people understand your single image?
>
> > think twice before you use the single image method...
> > it is definitely accessiblity evil and hacky...- 隱藏被引用文字 -
>
> - 顯示被引用文字 -



[jQuery] onload after page is loaded via ajax created elements - is there a better way ?

2007-06-23 Thread [EMAIL PROTECTED]

Having issues running scripts via the elements created from an ajax
call with Internet Explorer, and found one way around it, by firing
off a little function on the call back. as below: loadMe()

In this way the second function can be used with no issue in IE and
Opera, FF never had a problem in the first place.

My question about this though, is there some function in jQuery that I
am missing that already covers this issue, or is there a better/
cleaner way of doing this?

Basic demo at: http://yournrl.com/

$(document).ready(function() {
  $("p").click( function() {
  $.post("import.php", function(data){
$("div#dataHere").html(data);
loadMe(); // on success response from post call without this IE and
Opera cant access the span click function
  });
  });
});

function loadMe(){
 if(alldone!==true){ // check that this function is not already
running
  $("span").click( function() {
  $.post("something-else.php", function(data){
$("div#dataHere").html(data);
  });
   });
 var alldone = true;
 }
}

Cheers

Stephen