Hide/Disable Hovercards

166 views
Skip to first unread message

SC

unread,
Apr 26, 2011, 3:42:57 AM4/26/11
to Twitter Anywhere Development
I need to temporarily disable or hide hovercards at certain times on
my site. Is there a function I can call to disable them?

Matt Harris

unread,
Apr 27, 2011, 1:32:53 PM4/27/11
to twitter-de...@googlegroups.com
Hey SC,

Hovercards only become active if you call them in the Javascript. By default hovercards will apply to the whole page if you call:

twttr.anywhere(function (T) {
    T.hovercards();
});

If you only want to have hovercards appear in certain places on your page you need to pass a selector as an argument of the T object. For example, if I only want hovercards to appear in a div with an ID of #hovercards I would use:

twttr.anywhere(function (T) {
    T('#hovercards').hovercards();
});

More information on this is available on our developer resources site here:

Hope that helps,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris


On Tue, Apr 26, 2011 at 12:42 AM, SC <sage...@gmail.com> wrote:
I need to temporarily disable or hide hovercards at certain times on
my site. Is there a function I can call to disable them?

--
Twitter @Anywhere documentation and resources: http://dev.twitter.com/anywhere/begin
@anywhere updates via Twitter: http://twitter.com/anywhere
Change your membership to this group: http://groups.google.com/group/twitter-dev-anywhere?hl=en

SC

unread,
May 12, 2011, 5:12:23 AM5/12/11
to Twitter Anywhere Development
Hi Matt,

Sorry it's taken me so long to reply! Completely forgot to check back
here. Thank you for your assistance. I'm trying to figure out how to
temporarily disable hovercards after they've been activated. Either
that, or just hide the iframe that they appear in. Does their iframe
have an id or class that I can use to hide them when necessary?

Thanks in advance!

On Apr 27, 10:32 am, Matt Harris <thematthar...@twitter.com> wrote:
> Hey SC,
>
> Hovercards only become active if you call them in the Javascript. By default
> hovercards will apply to the whole page if you call:
>
> twttr.anywhere(function (T) {
>     T.hovercards();
>
> });
>
> If you only want to have hovercards appear in certain places on your page
> you need to pass a selector as an argument of the T object. For example, if
> I only want hovercards to appear in a div with an ID of #hovercards I would
> use:
>
> twttr.anywhere(function (T) {
>     T('#hovercards').hovercards();
>
> });
>
> More information on this is available on our developer resources site here:
>    http://dev.twitter.com/pages/anywhere_begin#hovercards
>
> Hope that helps,
> @themattharris
> Developer Advocate, Twitterhttp://twitter.com/themattharris

Abraham Williams

unread,
May 12, 2011, 11:40:39 AM5/12/11
to twitter-de...@googlegroups.com
Just remove the twitter-anywhere-user class from all the links to disable and when you want to enable hovercards again add the class back.

Abraham
-------------
Abraham Williams | InboxQ | abrah.am
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.

SC

unread,
May 12, 2011, 4:42:27 PM5/12/11
to Twitter Anywhere Development
Here is my issue: When the div containing the hovercard link refreshes
while the hovercard is displayed, the hovercard gets "stuck" and won't
disappear on mouseout. The only way to get rid of the hovercard is to
hover over another hovercard link to reload the card and then
mouseout. Another issue is if the div refreshes just as the hovercard
is beginning to load, then the hovercard pops up in the top-left
corner instead of over the link. Any suggestions for resolving these
issues?

Thanks!

On May 12, 8:40 am, Abraham Williams <4bra...@gmail.com> wrote:
> Just remove the twitter-anywhere-user class from all the links to disable
> and when you want to enable hovercards again add the class back.
>
> Abraham
> -------------
> Abraham Williams | InboxQ <http://inboxq.com/> | abrah.am
> @abraham <https://twitter.com/abraham> | github.com/abraham | blog.abrah.am

Abraham Williams

unread,
May 13, 2011, 3:11:31 AM5/13/11
to twitter-de...@googlegroups.com
You will probably either have to build your own hovercards that support this type of behavior or hack doing stuff like:

jQuery('iframe.twitter-bubble').css('z-index', -20); or jQuery('iframe.twitter-bubble').remove();

They both probably have downsides that you will have to work around.

Abraham
-------------
Abraham Williams | InboxQ | abrah.am

This email is: [ ] shareable [x] ask first [ ] private.
Reply all
Reply to author
Forward
0 new messages