Skip to content

Instantly share code, notes, and snippets.

@elvisgiv
Last active April 26, 2017 08:41
Show Gist options
  • Save elvisgiv/9815377877eab8aa875b99f771b78479 to your computer and use it in GitHub Desktop.
Save elvisgiv/9815377877eab8aa875b99f771b78479 to your computer and use it in GitHub Desktop.

change link image when hover or clicked or both

        %a{:href => link_page("price")}
          %img{:onmouseout => "this.src='YOUR_START_IMAGE'", :onmouseover => "this.src='YOUR_IMAGE_'",
              :onclick => "this.src='YOUR_IMAGE_AFTER_CLICK'", :src => "YOUR_START_IMAGE"}

Be sure to write the quote marks exactly as they are here, or it will not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment