DavidIQ wrote:How do you let the user expand the image using only CSS?
If you don't need any fancy animations, then:
CSS:
Code: Select all
.image{
width: 100px;
height: auto;
}
.image:hover{
width: 531px;
height: auto;
}
If you want to choose when you want to do that using other rules, but still no need for animations:
CSS:
Code: Select all
.image{
width: 100px;
height: auto;
}
.image.showHuge{
width: 531px;
height: auto;
}
javascript (the jQuery equivalent may be used):
Code: Select all
imageNode.classList.add('showHuge');
to return to normal:
Code: Select all
imageNode.classList.remove('showHuge');
If you need animations, you may use "beautiful" CSS animations and just don't care about animating for the IE8 and IE9. If you do care about those 2 in those animations, then we have the jQuery animations.
(forgot to post this...)
EDIT:
using callumacrae's idea:
http://jsfiddle.net/UR8qm/2/