# Page\[\].visual\_effect problem

**URL:** <https://www.ruby-forum.com/t/page-visual-effect-problem/86651>\
**Category:** Rails\
**Created:** [February 24, 2007, 2:35am UTC](https://www.ruby-forum.com/t/page-visual-effect-problem/86651 "2007-02-24T02:35:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [February 24, 2007, 2:35am UTC](https://www.ruby-forum.com/t/page-visual-effect-problem/86651/1 "2007-02-24T02:35:38Z")

</div>

Hi…

I don’t know what I’m doing wrong but I can’t seem to get this code to  
work:

page[:invite].replace\_html @message  
page[:invite].visual\_effect(:Highlight)

But this works:

page.replace\_html(“invite” , @message)  
page.visual\_effect( :highlight, “invite”)

This is the error I get:  
$(“invite”).update(“user already belongs to your group.”);  
$(“invite”).visualEffect(:Highlight");

Seems llike they both should work.

Any help would be great.

- Mark

---

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [January 25, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/page-visual-effect-problem/86651/2 "2008-01-25T14:51:30Z")

</div>

Mark S. wrote:

> Hi…
> 
> I don’t know what I’m doing wrong but I can’t seem to get this code to  
> work:
> 
> page[:invite].replace\_html @message  
> page[:invite].visual\_effect(:Highlight)

> Any help would be great.
> 
> - Mark

I got same problem.

So I tried to change effect.js,

you can find keyword ‘visualEffect’, and change like below.

visualEffect: function(element, effect, options) {  
element = $(element)  
if (effect.startsWith(‘toggle\_’)) {  
var s = effect.gsub(/toggle\_/, ‘’)  
Effect.toggle(element, s);  
} else {  
var s = effect.dasherize().camelize(), klass =  
s.charAt(0).toUpperCase() + s.substring(1);  
new Effect[klass](element, options);  
}  
return element;  
},
