tszming / jquery-swapimage Goto Github PK
View Code? Open in Web Editor NEWSwap image with jQuery
License: Other
Swap image with jQuery
License: Other
Hi:
My Rails 2.3.8 app includes many examples of submit button code like this:
<%= image_submit_tag 'postPublicRequestNormal.gif',
:class => "swapImage {src: 'postPublicRequestHover.gif'}" %>
This has always allowed me to swap a different button image in when the user mouses over the button.
I'm trying to upgrade the app to Rails 3 (3.1, in particular) and I'm noticing now after I've turned on the asset pipeline that the rollovers are broken. Rolling over a button yields a broken-image-link.
Looking at the output of view source, I find that the single quotes around the name of my hover state image are now being escaped:
I'm not sure if this is because of some enhanced sanitization behavior in Rails 3.1 or what the reason might be.
Can you suggest ways for me to fix this issue? Or is the real problem something different than the escaping of the single quote?
Thanks very much,
Dean Richardson
Genlighten.com
Hi,
This isn't an "issue". It's more of a feature inquiry/request.
Does this code allow a third image state for the one image swap?
e.g.
Image 1 = Default
Image 2 = Mouse hover
Image 3 = Mouse click
If not are there any plan to add this and could someone point me in the right direction for achieving this?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.