Comments (9)
I would suggest using jquery to perform the image-swap, or css if possible. You'll have a MUCH easier time of it with either of these two solutions.
from anythingslider.
would you like me to send you a zip of an example?
& before i do i'll try with jquery, do you have a recommendation or example i can refer to?
from anythingslider.
Merrifield69, try adding an ID like this:
<a href="#"><img src="images/slide-civil-1.jpg" id="test" alt="" /></a>
$('#test').hover(function(){
this.old = this.src;
this.src = 'images/slide-env-1.jpg';
},function(){
this.src = this.old;
});
from anythingslider.
Thank you Morttie,
This jquery rollover does work outside of the li tags
but once inclosed in li tags it does not work. like so
<div class="anythingSlider">
<div class="wrapper">
<ul>
<li>
<a href="#"><img src="images/ring/ring.png" id="test" alt="" /></a>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
$('#test').hover(function(){
this.old = this.src;
this.src = 'images/ring/project_on.png';
},function(){
this.src = this.old;
});
</script>
from anythingslider.
It works for me.. I think you need to wrap the script above with a $(document).ready(function(){...})
, like this:
$(document).ready(function(){
$('#test').hover(function(){
this.old = this.src;
this.src = 'images/slide-civil-2.jpg';
},function(){
this.src = this.old;
});
});
from anythingslider.
Beautiful, that works Mottie, thank you for that.
last question i promise :]
is there anyway to change this image to different images based on where the user hovered. previously i was using an image map and an onmouseover swap image script, but im not sure how i would do that with jquery...
Thank you
from anythingslider.
Well you could create a bunch of links and position them using css on top of an image in different arrangements, creating hover events for each. Honestly though when the hovering approach gets complex I still fall back to a map out of convenience. Nothing stops you from using jquery with a map though, just learn how to use jQuery selectors properly.
from anythingslider.
I've finally got it working!
Thank you very much ProLoser & Mottie
from anythingslider.
No problem, glad it works.
from anythingslider.
Related Issues (20)
- FX demos aren't working HOT 2
- Slider height collapses by removing height from container class HOT 4
- Video demo doesn't work HOT 3
- Can't just use CSS HOT 2
- html5 video slider issue HOT 2
- Photos are being rotated HOT 4
- resizeContents false does not leave division at constant height HOT 6
- Metallic.css breaks slide show button HOT 2
- iframe not scrolling on iPad HOT 2
- Play button not Visible on IPad HOT 3
- jQuery .data() values are lost in cloned elements HOT 4
- JW Player is not working HOT 2
- Loading issue HOT 4
- undefined error when infiniteSlides = false and showMultiple = X HOT 2
- Can't get slider working... HOT 2
- Slider take a delay after video playing is complete HOT 4
- Single Video playing issue HOT 3
- jQuery 3 compatibility
- issue with window.location HOT 1
- Image stacking when using https:// HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anythingslider.