# Mouseover Speed Issues

**URL:** <https://www.ruby-forum.com/t/mouseover-speed-issues/95996>\
**Category:** Rails\
**Created:** [June 22, 2006, 1:28am UTC](https://www.ruby-forum.com/t/mouseover-speed-issues/95996 "2006-06-22T01:28:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@blewis](https://www.ruby-forum.com/u/blewis)\
**Post date:** [June 22, 2006, 1:28am UTC](https://www.ruby-forum.com/t/mouseover-speed-issues/95996/1 "2006-06-22T01:28:52Z")

</div>

I’m having severe speed issues on our server (localhost is lightening  
fast!).

Here’s the call:  
\<img src= \<%= @pics[col].img\_url %\> height=80 width=60 onMouseover="\<%=  
remote\_function(:update =\> “diag\_box”, :url =\> { :action =\> :preview,  
:tit =\> @pics[col].mname, :desc =\> @pics[col].description })%\>;"\>

It’s an image, that when moused-over, it calls the function :preview,  
and passes :tit and :desc. The results of :preview will get rendered in  
the div :update.

The preview function just does  
render\_text “**” + params[:tit] + “**  
” + params[:desc]

Is there a better way to do this?  
Why does it load so slowwwwwww on our server but not in localhost?

-Ben

---

<div class="post-metadata">

**Author:** ![blewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@blewis](https://www.ruby-forum.com/u/blewis)\
**Post date:** [June 22, 2006, 2:06pm UTC](https://www.ruby-forum.com/t/mouseover-speed-issues/95996/2 "2006-06-22T14:06:13Z")

</div>

Make sure your link\_to\_remote is not triggered multiple times for the  
same  
image.  
Also you should check the logs on your server and see how quickly is  
your  
request processed.

---

<div class="post-metadata">

**Author:** ![blewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@blewis](https://www.ruby-forum.com/u/blewis)\
**Post date:** [June 22, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/mouseover-speed-issues/95996/3 "2006-06-22T14:19:24Z")

</div>

Ben L. wrote:

> …height=80 width=60…

> Is there a better way to do this?  
> Why does it load so slowwwwwww on our server but not in localhost?

Is that the actual size of the image on the server? If so, the image  
should only be 2K or so, and it should look adequately fast. But if  
you’re shoveling 20 or 30K over the net and using this specification to  
resize a larger image, it will look slow.

In this case, the thing to do would be to make your thumbnails on the  
server end.

–Al Evans
