Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. How can I change image on hover?

How can I change image on hover?

Scheduled Pinned Locked Moved SharePoint
javascriptquestioncsharpasp-netsharepoint
3 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Danpeking
    wrote on last edited by
    #1

    Hi, on my SharePoint 2013 site I wish to change an image on the mouse hover over it to a completely different image. I can do this fine in ASP.NET with JavaScript but SharePoint strips out the onmouseover and onmouseout text from my controls. How can I do this otherwise? I've not installed/setup jQuery and would need instructions on how to do that please if that is an offered solution.

    H A 2 Replies Last reply
    0
    • D Danpeking

      Hi, on my SharePoint 2013 site I wish to change an image on the mouse hover over it to a completely different image. I can do this fine in ASP.NET with JavaScript but SharePoint strips out the onmouseover and onmouseout text from my controls. How can I do this otherwise? I've not installed/setup jQuery and would need instructions on how to do that please if that is an offered solution.

      H Offline
      H Offline
      Hitesh Sharma _
      wrote on last edited by
      #2

      HTML Jquery $('#imageid').hover(function() { $(this).attr('src', '/folder/image2.jpg'); }, function() { $(this).attr('src', '/folder/image1.jpg'); });

      1 Reply Last reply
      0
      • D Danpeking

        Hi, on my SharePoint 2013 site I wish to change an image on the mouse hover over it to a completely different image. I can do this fine in ASP.NET with JavaScript but SharePoint strips out the onmouseover and onmouseout text from my controls. How can I do this otherwise? I've not installed/setup jQuery and would need instructions on how to do that please if that is an offered solution.

        A Offline
        A Offline
        AbuNav
        wrote on last edited by
        #3

        There will be 2 Parts for this: 1. Css .hover { backgroundImage: "image 2 URL"; } 2. JQuery $( divId ).hover( function() { $( this ).addClass( "hover" ); }, function() { $( this ).removeClass( "hover" ); } );

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups