Forum: Ruby on Rails anyone know a good way to do a caption popup on mouseover?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Debcfd8f3f533800e2711c704825f9c0?d=identicon&s=25 Scott Kulik (kuliksco)
on 2008-12-18 06:18
I have been using overlib (javascript library) to create popups on
mouseover but it has issues with some browsers.

I just need something simple and was wondering if any had any
suggestions.
359b7a7fc263382baee62d91c1e4c25e?d=identicon&s=25 Emanuele Tozzato (mekdigital)
on 2008-12-18 06:55
(Received via mailing list)
I needed something very simple and flexible, so I put this in my
app.html.erb:

<div id="info_bubble">
</div>

this in app.js

function info(obj, msg){
  if (msg) {
    $('info_bubble').innerHTML = msg;
    $('info_bubble').style.top = obj.y + 'px'
    $('info_bubble').style.left = 30 + obj.x + 'px'
    $('info_bubble').style.visibility = 'visible';
  } else { $('info_bubble').style.visibility = 'hidden' }
}

this is app.css

#info_bubble {
  opacity: .80;
  filter: alpha(opacity=80);
  position:absolute;
  border:1px #333 solid;
  visibility:hidden;
  font-size:10px;
  font-family: verdana;
  color:#000;
  font-weight:bold;
  background:#85a5d6;
  padding:5px;
}

and added the tag on the object :onMouseOver => "info(this,
'download')", :onMouseOut => "info()"

it worked for me, but I have the bad habit to do everything in house..
:)

On Wed, Dec 17, 2008 at 9:18 PM, Scott Kulik
<rails-mailing-list@andreas-s.net> wrote:
>
--
Emanuele Tozzato
+1 (619) 549 3230
4955 Narragansett Ave Apt #9
San Diego Ca 92107-3157
http://mekdigital.com
Debcfd8f3f533800e2711c704825f9c0?d=identicon&s=25 Scott Kulik (kuliksco)
on 2008-12-18 19:28
cool thanks i'll test it out this week!
Debcfd8f3f533800e2711c704825f9c0?d=identicon&s=25 Scott Kulik (kuliksco)
on 2008-12-19 00:01
Scott Kulik wrote:
> cool thanks i'll test it out this week!

i just got it working.  i like it because it's so simple but is there
anyway to have the popup show up at the mouse pointer instead of a fixed
location?

i dont know javascript very well offhand.

also, it looks like it's getting invalid argument on IE7 :(
359b7a7fc263382baee62d91c1e4c25e?d=identicon&s=25 Emanuele Tozzato (mekdigital)
on 2008-12-19 00:19
(Received via mailing list)
I did not try it on god-damn-IE.. =)

you should modify the js part with code from this example
http://www.codelifter.com/main/javascript/capturem...,
the script was originally based on mouse position, but I thought it
was annoying.. :)

On Thu, Dec 18, 2008 at 3:01 PM, Scott Kulik
<rails-mailing-list@andreas-s.net> wrote:
> also, it looks like it's getting invalid argument on IE7 :(
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>



--
Emanuele Tozzato
+1 (619) 549 3230
4955 Narragansett Ave Apt #9
San Diego Ca 92107-3157
http://mekdigital.com
Debcfd8f3f533800e2711c704825f9c0?d=identicon&s=25 Scott Kulik (kuliksco)
on 2008-12-19 06:42
Emanuele Tozzato wrote:
> I did not try it on god-damn-IE.. =)
>
> you should modify the js part with code from this example
> http://www.codelifter.com/main/javascript/capturem...,
> the script was originally based on mouse position, but I thought it
> was annoying.. :)
>

hmm...looks like the link is redirecting to their homepage.  i'll take a
look around the site.
D6434aa0b7b350f8c3ed0119d81b2ead?d=identicon&s=25 Roy Pardee (rpardee)
on 2008-12-19 18:15
(Received via mailing list)
title= tag attributes maybe?
This topic is locked and can not be replied to.