[Proto-Scripty] Re: Simple question

2008-11-27 Thread Mona Remlawi

Hi JC,

Best way to do this is by using the Event.observe method
(http://prototypejs.org/api/event/observe)
to attach your fading method to designated divs.

// assign a class name to the divs you want to have the fading behaviour
div class=fadeableClick me to fade away/div
div class=fadeableor click me to fade away/div

// event.target to get the element that fired the click event
function myeffect(event) {
event.target.fade({ duration: 3.0, from: 1, to: 0 });
}

// on domload, find all elements with fadeable class name
// observe their click event and attach myeffect as its handler
document.observe('dom:loaded', function() {
$$('.fadeable').invoke(observe, click, myeffect);
});

That's how i would do it, complete separation between html and its behaviour.

Or of course,  you can also
div onclick=myeffect(this)Click me to fade away/div

function myeffect(zdiv) {
   zdiv.fade({ duration: 3.0, from: 0, to: 1 });
}

But I strongly advice the first approach.

cheers

--
mona
[EMAIL PROTECTED]

On Wed, Nov 26, 2008 at 10:56 PM, justclint [EMAIL PROTECTED] wrote:

 Im just getting into script.aculo.us by way of cakephp. As for
 javascript frameworks Ive only used jquery.

 This question is so basic I cant find anything on past posts here in
 the groups hence this post.

 Basically I just took a random effect and it worked as described in
 the github area by applying it to an element selected by id.

 Im trying to get the effect to work not by id but by this. Heres
 my example but not working:

 script:
 code
 script type=text/javascript language=javascript
  // ![CDATA[
function myeffect() {
$(this).fade({ duration: 3.0, from: 0, to: 1 });
}
  // ]]
 /script
 /code

 html
 code
 div onclick=myeffect()
  Click me to fade away
 /div
 div onclick=myeffect()
  or click me to fade away
 /div
 /code

 I dont see any documentation on how to apply to document.this

 Im sure my syntax is wrong but everyway I switch it around it still
 wont work.

 What am I doing wrong?

 Thanks in advance!

 jc

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Developing group checkbox

2008-11-27 Thread Mona Remlawi

Hi Arun,

A way to go around this is to group your checkboxes by classname. Then
observe the click event on all checkboxes to check/uncheck all other
checkboxes with same classname.

cheers

--
mona
[EMAIL PROTECTED]

On Thu, Nov 27, 2008 at 5:14 AM, Arun [EMAIL PROTECTED] wrote:

 Hi Walter ,

 Thank you for your response.
 What you guess is correct,
 For example

 [] Apple
 [] Cat
 [] Rat
 [] Orange
 [] Pears

 If i click Apple or Orange or Pears all the other checkbox associated
 with any fruit name should be checked like below

 Clicking  Apple or Orange

 [x] Apple
 [ ] Cat
 [ ] Rat
 [x] Orange
 [x] Pears

 With Regards
 -Arun

 On Nov 26, 9:48 pm, Walter Lee Davis [EMAIL PROTECTED] wrote:
 On Nov 26, 2008, at 8:32 AM, Arun wrote:

  Hi All,

  Can we create a group checkbox using prototypejs?
  Appreciate if anybody could guide me how to do Group checkbox using

 prototypejs.

 I'm not familiar with this feature name, can you explain in general
 terms what it might mean? For example, I am guessing that you might
 mean something like click this widget and all associated checkboxes
 get checked, but that's just a very distant guess.

 Thanks,

 Walter
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Simple question

2008-11-27 Thread seasoup

I think this is what you are trying to do:

script:
code
script type=text/javascript language=javascript
  // ![CDATA[
function myeffect(obj) {
$(obj).fade({ duration: 3.0, from: 0, to: 1 });
}
  // ]]
/script
/code

html
code
div onclick=myeffect(this)
  Click me to fade away
/div
div onclick=myeffect(this)
  or click me to fade away
/div
/code

but this can be achieved by
div class=fadeAway
  Click me to fade away
/div
div class=fadeAway
  or click me to fade away
/div

$$('fadeAway').observe('click', function(event) {
  var element = event.element();
  $(element).fade({ duration: 3.0, from: 0, to: 1 });
});

actually, I'm not sure if prototype can chain the observe like that,
you might need to:


$$('fadeAway').each(function(obj){
  $(obj).observe('click', function(event) {
var element = event.element();
$(element).fade({ duration: 3.0, from: 0, to: 1 });
  });
});


Since you know jQuery, the equivalent in jQuery is:

$('fadeAway').click(function() {
  $(this).fadeOut('slow');
});



On Nov 26, 1:56 pm, justclint [EMAIL PROTECTED] wrote:
 Im just getting into script.aculo.us by way of cakephp. As for
 javascript frameworks Ive only used jquery.

 This question is so basic I cant find anything on past posts here in
 the groups hence this post.

 Basically I just took a random effect and it worked as described in
 the github area by applying it to an element selected by id.

 Im trying to get the effect to work not by id but by this. Heres
 my example but not working:

 script:
 code
 script type=text/javascript language=javascript
   // ![CDATA[
 function myeffect() {
 $(this).fade({ duration: 3.0, from: 0, to: 1 });
 }
   // ]]
 /script
 /code

 html
 code
 div onclick=myeffect()
   Click me to fade away
 /div
 div onclick=myeffect()
   or click me to fade away
 /div
 /code

 I dont see any documentation on how to apply to document.this

 Im sure my syntax is wrong but everyway I switch it around it still
 wont work.

 What am I doing wrong?

 Thanks in advance!

 jc

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Developing group checkbox

2008-11-27 Thread spradeepkumar
hey arun,

what mona suggested was a perfect solution, but you do not need prototype 
help..for implementing it..if you are a developer in javascript...

But prototype easy solution for the requirement...

use Element.observe -- to listen for the toggle on click event..
use Element.hasClassName(classname) ---to check whether the particular check 
box exists
use Element.toggleClassName(classname)---to toggle the checkbox as the 
unselected check box.

Hope this clarifies

Regards,
pradeep


 On Thu, 27 Nov 2008 Mona Remlawi [EMAIL PROTECTED] wrote  

  
  Hi Arun,
  
  A way to go around this is to group your checkboxes by classname. Then
  observe the click event on all checkboxes to check/uncheck all other
  checkboxes with same classname.
  
  cheers
  
  --
  mona
  [EMAIL PROTECTED]
  
  On Thu, Nov 27, 2008 at 5:14 AM, Arun [EMAIL PROTECTED] wrote:
  
   Hi Walter ,
  
   Thank you for your response.
   What you guess is correct,
   For example
  
   [] Apple
   [] Cat
   [] Rat
   [] Orange
   [] Pears
  
   If i click Apple or Orange or Pears all the other checkbox associated
   with any fruit name should be checked like below
  
   Clicking  Apple or Orange
  
   [x] Apple
   [ ] Cat
   [ ] Rat
   [x] Orange
   [x] Pears
  
   With Regards
   -Arun
  
   On Nov 26, 9:48 pm, Walter Lee Davis [EMAIL PROTECTED] wrote:
   On Nov 26, 2008, at 8:32 AM, Arun wrote:
  
Hi All,
  
Can we create a group checkbox using prototypejs?
Appreciate if anybody could guide me how to do Group checkbox using
  
   prototypejs.
  
   I'm not familiar with this feature name, can you explain in general
   terms what it might mean? For example, I am guessing that you might
   mean something like click this widget and all associated checkboxes
   get checked, but that's just a very distant guess.
  
   Thanks,
  
   Walter
   
  
  
  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Simple question

2008-11-27 Thread spradeepkumar
Hey JC,

first let me clarify about this  refers to object.

If you are particular in using this...then no need to worry about that 
because prototype has got 
bind methods with which you can control your scope


Regards,
pradeep.

 On Thu, 27 Nov 2008 Mona Remlawi [EMAIL PROTECTED] wrote  

  
  Hi JC,
  
  Best way to do this is by using the Event.observe method
  (http://prototypejs.org/api/event/observe)
  to attach your fading method to designated divs.
  
  // assign a class name to the divs you want to have the fading behaviour
  div class=fadeableClick me to fade away/div
  div class=fadeableor click me to fade away/div
  
  // event.target to get the element that fired the click event
  function myeffect(event) {
  event.target.fade({ duration: 3.0, from: 1, to: 0 });
  }
  
  // on domload, find all elements with fadeable class name
  // observe their click event and attach myeffect as its handler
  document.observe('dom:loaded', function() {
  $('.fadeable').invoke(observe, click, myeffect);
  });
  
  That's how i would do it, complete separation between html and its behaviour.
  
  Or of course,  you can also
  div onclick=myeffect(this)Click me to fade away/div
  
  function myeffect(zdiv) {
 zdiv.fade({ duration: 3.0, from: 0, to: 1 });
  }
  
  But I strongly advice the first approach.
  
  cheers
  
  --
  mona
  [EMAIL PROTECTED]
  
  On Wed, Nov 26, 2008 at 10:56 PM, justclint [EMAIL PROTECTED] wrote:
  
   Im just getting into script.aculo.us by way of cakephp. As for
   javascript frameworks Ive only used jquery.
  
   This question is so basic I cant find anything on past posts here in
   the groups hence this post.
  
   Basically I just took a random effect and it worked as described in
   the github area by applying it to an element selected by id.
  
   Im trying to get the effect to work not by id but by this. Heres
   my example but not working:
  
   script:
   code
   script type=text/javascript language=javascript
// ![CDATA[
  function myeffect() {
  $(this).fade({ duration: 3.0, from: 0, to: 1 });
  }
// ]]
   /script
   /code
  
   html
   code
   div onclick=myeffect()
Click me to fade away
   /div
   div onclick=myeffect()
or click me to fade away
   /div
   /code
  
   I dont see any documentation on how to apply to document.this
  
   Im sure my syntax is wrong but everyway I switch it around it still
   wont work.
  
   What am I doing wrong?
  
   Thanks in advance!
  
   jc
  
   
  
  
  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Scriptaculous 1.8.2 : bug introduced in Sortable.destroy (missing null check?)

2008-11-27 Thread Olivier Jaquemet

Hi all,

I have probably find a bug in the latest release of Scriptaculous :

In 1.8.1 (line 612)
  destroy: function(element){
var s = Sortable.options(element);
if(s) {

In 1.8.2 (line 612)
  destroy: function(element){
element = $(element);
var s = Sortable.sortables[element.id];
if(s) {

Problem : if the DOM has been modified, the element might not exist
anymore, thus throwing an exception.

Proposed patch :
  destroy: function(element){
element = $(element);
if(!element) return;
var s = Sortable.sortables[element.id];
if(s) {

Can you confirm this issue ?

Regards,
Olivier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Simple question

2008-11-27 Thread RobG



On Nov 27, 11:32 pm, spradeepkumar [EMAIL PROTECTED] wrote:
[...]
 If you are particular in using this...prototype has got
 bind methods with which you can control your scope

The value of a function's this keyword has nothing to do with scope,
it is set by the call.


--
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] .getHeight() is not a function

2008-11-27 Thread Diodeus

This code works in IE, bot for FF:

var prev = $(element).previousSibling
alert(prev.getHeight())

In FF gives me prev.getHeight()) is not a function.

Has FF gone mad? Have I?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: .getHeight() is not a function

2008-11-27 Thread Ken Snyder
Be sure to extend the previousSibling element:

var prev = $(element).previousSibling
alert($(prev).getHeight())

- Ken

On Thu, Nov 27, 2008 at 8:53 AM, Diodeus [EMAIL PROTECTED] wrote:


 This code works in IE, bot for FF:

 var prev = $(element).previousSibling
 alert(prev.getHeight())

 In FF gives me prev.getHeight()) is not a function.

 Has FF gone mad? Have I?

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: .getHeight() is not a function

2008-11-27 Thread Diodeus

Nope, that doesn't work either.


On Nov 27, 11:40 am, Ken Snyder [EMAIL PROTECTED] wrote:
 Be sure to extend the previousSibling element:

 var prev = $(element).previousSibling
 alert($(prev).getHeight())

 - Ken

 On Thu, Nov 27, 2008 at 8:53 AM, Diodeus [EMAIL PROTECTED] wrote:

  This code works in IE, bot for FF:

  var prev = $(element).previousSibling
  alert(prev.getHeight())

  In FF gives me prev.getHeight()) is not a function.

  Has FF gone mad? Have I?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Effect.Morph using class names

2008-11-27 Thread Diodeus

Is it possible to specify a CSS class name instead of a style for
Effect.Morph?

This doesn't work, I wish it would:

new Effect.Morph('test',{className:'med',duration:.2})
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Developing group checkbox

2008-11-27 Thread Arun

Hi Pradeep and Mona,

Thanks for your valuable comments.
Now i got an idea to do it.

Regards
-Arun

On Nov 27, 6:24 pm, spradeepkumar [EMAIL PROTECTED] wrote:
 hey arun,

 what mona suggested was a perfect solution, but you do not need prototype 
 help..for implementing it..if you are a developer in javascript...

 But prototype easy solution for the requirement...

 use Element.observe -- to listen for the toggle on click event..
 use Element.hasClassName(classname) ---to check whether the particular check 
 box exists
 use Element.toggleClassName(classname)---to toggle the checkbox as the 
 unselected check box.

 Hope this clarifies

 Regards,
 pradeep

  On Thu, 27 Nov 2008 Mona Remlawi [EMAIL PROTECTED] wrote 

  
   Hi Arun,
  
   A way to go around this is to group your checkboxes by classname. Then
   observe the click event on all checkboxes to check/uncheck all other
   checkboxes with same classname.
  
   cheers
  
   --
   mona
   [EMAIL PROTECTED]
  
   On Thu, Nov 27, 2008 at 5:14 AM, Arun [EMAIL PROTECTED] wrote:
   
    Hi Walter ,
   
    Thank you for your response.
    What you guess is correct,
    For example
   
    [] Apple
    [] Cat
    [] Rat
    [] Orange
    [] Pears
   
    If i click Apple or Orange or Pears all the other checkbox associated
    with any fruit name should be checked like below
   
    Clicking  Apple or Orange
   
    [x] Apple
    [ ] Cat
    [ ] Rat
    [x] Orange
    [x] Pears
   
    With Regards
    -Arun
   
    On Nov 26, 9:48 pm, Walter Lee Davis [EMAIL PROTECTED] wrote:
    On Nov 26, 2008, at 8:32 AM, Arun wrote:
   
     Hi All,
   
     Can we create a group checkbox using prototypejs?
     Appreciate if anybody could guide me how to do Group checkbox using
   
    prototypejs.
   
    I'm not familiar with this feature name, can you explain in general
    terms what it might mean? For example, I am guessing that you might
    mean something like click this widget and all associated checkboxes
    get checked, but that's just a very distant guess.
   
    Thanks,
   
    Walter
    
   
  
  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph using class names

2008-11-27 Thread Walter Lee Davis

Maybe, if one were to create an object off screen, run addClass to add  
the style, then use getStyle to read it back, and then apply that as  
the argument to Morph. Seems like a lot of work, but since Morph uses  
getStyle and setStyle internally, that's what will have to happen (I  
think).

Walter

On Nov 27, 2008, at 12:50 PM, Diodeus wrote:


 Is it possible to specify a CSS class name instead of a style for
 Effect.Morph?

 This doesn't work, I wish it would:

 new Effect.Morph('test',{className:'med',duration:.2})

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: .getHeight() is not a function

2008-11-27 Thread jason maina

My 2cents contribution:
What is output for alert(prev)? This will only help in identifing if
the element actually can be identified or even exists...

Regards
jason

On 11/27/08, Diodeus [EMAIL PROTECTED] wrote:

 Nope, that doesn't work either.


 On Nov 27, 11:40 am, Ken Snyder [EMAIL PROTECTED] wrote:
 Be sure to extend the previousSibling element:

 var prev = $(element).previousSibling
 alert($(prev).getHeight())

 - Ken

 On Thu, Nov 27, 2008 at 8:53 AM, Diodeus [EMAIL PROTECTED] wrote:

  This code works in IE, bot for FF:

  var prev = $(element).previousSibling
  alert(prev.getHeight())

  In FF gives me prev.getHeight()) is not a function.

  Has FF gone mad? Have I?
 


-- 
Sent from Gmail for mobile | mobile.google.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph using class names

2008-11-27 Thread Diodeus

I managed to hack my own, although I'll probably have to go test it on
every browser now.

new Effect.Morph(next,{style:getStyle('.med'),duration:.2})

function getStyle(className) {
var classes = document.styleSheets[0].rules || document.styleSheets
[0].cssRules
for(var x=0;xclasses.length;x++) {
if(classes[x].selectorText==className) {
return (classes[x].cssText || 
classes[x].style.cssText).toLowerCase
().replace('\n','')
}
}
}


On Nov 27, 3:00 pm, Walter Lee Davis [EMAIL PROTECTED] wrote:
 Maybe, if one were to create an object off screen, run addClass to add
 the style, then use getStyle to read it back, and then apply that as
 the argument to Morph. Seems like a lot of work, but since Morph uses
 getStyle and setStyle internally, that's what will have to happen (I
 think).

 Walter

 On Nov 27, 2008, at 12:50 PM, Diodeus wrote:



  Is it possible to specify a CSS class name instead of a style for
  Effect.Morph?

  This doesn't work, I wish it would:

  new Effect.Morph('test',{className:'med',duration:.2})
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Simple question

2008-11-27 Thread seasoup

$(selector).each(function(){
  alert(this);
}.bind($(somethingElse));

sets somethingElse as the 'this' inside of the each function, instead
of the item in the array.  That's what spradeepkumar was referring to
by controlling scope.

On Nov 27, 7:14 am, RobG [EMAIL PROTECTED] wrote:
 On Nov 27, 11:32 pm, spradeepkumar [EMAIL PROTECTED] wrote:
 [...]

  If you are particular in using this...prototype has got
  bind methods with which you can control your scope

 The value of a function's this keyword has nothing to do with scope,
 it is set by the call.

 --
 Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Simple question

2008-11-27 Thread seasoup

oops, I was in jQuery mode.

$('id').each(function(eachThing) {

}.bind($('anotherId'));

still binds another id to this inside of the each function.  But for
eventlisteners you need to .bindAsEventListener()

On Nov 27, 7:14 am, RobG [EMAIL PROTECTED] wrote:
 On Nov 27, 11:32 pm, spradeepkumar [EMAIL PROTECTED] wrote:
 [...]

  If you are particular in using this...prototype has got
  bind methods with which you can control your scope

 The value of a function's this keyword has nothing to do with scope,
 it is set by the call.

 --
 Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Simple question

2008-11-27 Thread kangax

On Nov 27, 5:54 pm, seasoup [EMAIL PROTECTED] wrote:
[...]
 still binds another id to this inside of the each function.  But for
 eventlisteners you need to .bindAsEventListener()

Not really. `bindAsEventListener` is only needed when currying
arguments to event handler.

[...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph using class names

2008-11-27 Thread Tobie Langel

It's already built-in :)

Try either:

new Effect.Morph('test',{style: 'med', duration: 0.2});

or:

$('test').morph('med', { duration: 0.2});

Best,

Tobie


On Nov 27, 9:27 pm, Diodeus [EMAIL PROTECTED] wrote:
 I managed to hack my own, although I'll probably have to go test it on
 every browser now.

 new Effect.Morph(next,{style:getStyle('.med'),duration:.2})

 function getStyle(className) {
         var classes = document.styleSheets[0].rules || document.styleSheets
 [0].cssRules
         for(var x=0;xclasses.length;x++) {
                 if(classes[x].selectorText==className) {
                         return (classes[x].cssText || 
 classes[x].style.cssText).toLowerCase
 ().replace('\n','')
                 }
         }

 }

 On Nov 27, 3:00 pm, Walter Lee Davis [EMAIL PROTECTED] wrote:

  Maybe, if one were to create an object off screen, run addClass to add
  the style, then use getStyle to read it back, and then apply that as
  the argument to Morph. Seems like a lot of work, but since Morph uses
  getStyle and setStyle internally, that's what will have to happen (I
  think).

  Walter

  On Nov 27, 2008, at 12:50 PM, Diodeus wrote:

   Is it possible to specify a CSS class name instead of a style for
   Effect.Morph?

   This doesn't work, I wish it would:

   new Effect.Morph('test',{className:'med',duration:.2})
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: .getHeight() is not a function

2008-11-27 Thread kangax

On Nov 27, 10:53 am, Diodeus [EMAIL PROTECTED] wrote:
 This code works in IE, bot for FF:

 var prev = $(element).previousSibling
 alert(prev.getHeight())

 In FF gives me prev.getHeight()) is not a function.

 Has FF gone mad? Have I?

Perhaps, `previousSibling` is not an element node, but a text/comment
node? If so, then using `previous()` instead of `previousSibling`
should do the trick.

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---