Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Problem with JavaScript mouse over element and text

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37081
    Al3ks
    Participant

    Hello everyone!
    I’m new here and I have a problem with JavaScript, would be very grateful if someone here can help me.

    Basically i have found some code and modified it to suit my need,
    http://jsfiddle.net/tz9XG/6/
    i think on this website somewhere. It is working well as I need, It shows a rounded rectangle filled with black color when hovered over an image. But when hovering I want it to show some text inside the rectangle.

    Any one can help me, please?

    Thanks in advance.
    Aleks

    #98687
    karlpcrowley
    Participant

    http://jsfiddle.net/tz9XG/7/

    The message displayed here is in the image tag
    also i centered text and set line-height to be the same as the height

    #98694
    Al3ks
    Participant

    Sweet!
    Thank you so much!

    #98700
    Al3ks
    Participant

    Sorry, I got one more slight problem.
    I tried to insert this code into my website but it doesn’t work the same way it works on jsfiddle.net.

    I’m just confused with what goes where. I have the CSS code in my css style sheet- works ok.
    And javascript, I tried putting it in the HTML, head but no results, tried attaching to the html as a separate js file- still the same.

    Would be really grateful for any help.
    Thanks

    #98704
    karlpcrowley
    Participant

    I normally include CSS and JS libraries in the head section and the functions just before the end of the body, hope this helps

    #98706
    Al3ks
    Participant

    Thanks for the reply. I’m just not familiar with JS Libraries, where can i get them from?

    #98708
    karlpcrowley
    Participant

    jQuery is a library, can’t get link on my phone but google it and itll be the first thing you find, you need it for this to work

    #98709
    Al3ks
    Participant

    All sorted. Thanks for the help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.