Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Facebook/Twitter hover effect

  • 12-07-2010 01:24AM
    #1
    Closed Accounts Posts: 121 ✭✭


    If you hover over a message on Facebook/Twitter the 'delete' or 'remove' link appears. I presumed this was done by javascript but after disabling javascript it still works. So how do they do this? How do they make these links appear when you hover over a message using only html?


Comments

  • Registered Users, Registered Users 2 Posts: 233 ✭✭synacron trion


    I took a quick look at the source for my Twitter timeline. Looks like it is being done using CSS. There is a CSS class called actions-hover that might be what you are looking for.


  • Closed Accounts Posts: 121 ✭✭compaqlaptop1


    I know some css is being used but I cant see how it is being done without javascript. How is hovering over an outter element setting an inner element's visiblity?


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    I know some css is being used but I cant see how it is being done without javascript. How is hovering over an outter element setting an inner element's visiblity?

    At a guess :
    a img {
     display:none;
    }
    
    a:hover img {
     display:block;
    }
    

    Bearing in mind positioning / size would need to be handled well in order for the content not to "jump", thereby screwing up the hover.


  • Closed Accounts Posts: 24 zoudards


    Hey,
    you can use the hover pseudo class on other elements, not just links.

    http://www.w3schools.com/CSS/css_pseudo_classes.asp

    Hope this helps
    Z.


Advertisement