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.

HTML question - applying classes to IMG

  • 21-02-2011 09:13PM
    #1
    Closed Accounts Posts: 112 ✭✭


    I downloaded the "IMG Mouseover" plugin for my wordpress.

    It should be quite straightforward to apply it to an image, however I am having difficulty.

    Here are the instructions:

    WordPress › IMG Mouseover « WordPress Plugins

    MY GOAL: What I'm trying to do is to have a small image A, that when moused over results in larger image B popping up.
    This allows you to create a simple image mouseover feature by adding properties to an image:
    It understands the following attributes which can be added to the HTML:
    • img.class="mouseover" (activates IMG mouseover for this image)
    • img.oversrc (If specified, this rewrites the image on mouse rollover)
    • img.clicksrc (If specified, this rewrites the image on mouse click)
    • img.noresize (If set, this will make the image have the natural dimensions instead of the dimensions of the original image).
    • a.class="mouseover" (activates A tag as a controller for another image, when clicked a class "selected" is tacked on)
    • a.for (Should be specified to point to target image. Image must be class mouseover)
    • a.for_link (If specified the ID of a link is replaced with this one)
    • a.src (If specified, the click will replace the image with this)
    • a.oversrc (If specified, the click will replace the image mouse rollover with this)
    • a.clicksrc (If specified, the click will replace the image mouse click with this)
    THANKS!

    So I am guessing its something like this, but it didnt work.

    <img img.class="mouseover" src="/pictureA.jpg">


Comments

  • Closed Accounts Posts: 9,698 ✭✭✭tricky D


    Should probably be <img class="mouseover" src="/pictureA.jpg"> not img.class


  • Closed Accounts Posts: 112 ✭✭DeanSmedley


    tricky D wrote: »
    Should probably be <img class="mouseover" src="/pictureA.jpg"> not img.class

    No sorry that don't work.

    This what I currently have, and it don't work:

    Could it be a chmod problem?


  • Closed Accounts Posts: 112 ✭✭DeanSmedley


    Ok, I got it working, Thanks for your help!!


  • Registered Users, Registered Users 2 Posts: 10,240 ✭✭✭✭Fanny Cradock


    Want to tell us how?


  • Closed Accounts Posts: 112 ✭✭DeanSmedley


    It's embarassing actually, but the reason it didnt look like it was working, was because I was using the same image for the img and the mouseover. When I used two different images I realsied that it was changing all along!!


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


    It's embarassing actually, but the reason it didnt look like it was working, was because I was using the same image for the img and the mouseover. When I used two different images I realsied that it was changing all along!!

    I'd actually spotted that in the quoted code :

    ....but given that the URLs were "example.com" I thought that was just an oversight in the example given, rather than your original code, and didn't want to seem like a smart-ass.


Advertisement