Tag: javascript
jQuery fader
by admin on Jun.23, 2010, under The programmers' dilemas
My friend Alex needed a little image fading effect for his blog. As an example, he gave me a nice Earth Hour gallery (i think it was the boston.com Earth Hour 2010 article). The idea is to overlap 2 images and provide a fading effect when the visitor clicks them. I’m sure there are hundreds of scripts that do the exact same thing, but I proffered to write the 10 lines of jQuery code myself.
Here’s an example of the effect: http://shakabut.com/examples/jqueryFader/.
This is the little piece of code:
.pictureFaderBox{
margin:0 auto;
cursor:pointer;
width:640px;
height:427px;
clear:both;
}
.on, .off{
position:absolute;
}
.on{
z-index:10;
}
.off{
z-index:5;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$(".pictureFaderBox .on").toggle(
function () {
$(this).animate({opacity: 0}, 900 );
},
function () {
$(this).animate({opacity: 1}, 900 )
}
);
});
</script>
Also, please check Alex’s post to see a great photo project: http://3punctefoto.blogspot.com/2010/06/pitestiul-urbanizat.html. The post is in Romanian, but the pictures are not
– don’t forget to click the images!
PS: If you like nice interface elements, check our web agency website and contact us.
To my/our/your IE6 users
by admin on Feb.11, 2010, under The programmers' dilemas
I was thinking to write a script that prevents IE6- users to see the sites I’m developing a long time ago, but I never seemed to have the time.
Fortunately a nice guy (I think his name is Mihai Ile) did, so he wrote this little script “that displays a warning message politely informing the user to upgrade the browser to a newer version (links to newest IE, Firefox, Opera, Safari, Chrome are provided)”.
Thank you Mihai! Thank you in the name of all frustrated web developers, who spend their precious time downgrading their code to support IE6 or explaining their customers and visitors why it’s not a good idea to use a browser that was produced 9 years ago.
Also, thanks Mirel for the link!
Update: Smashing Magazine published a niceĀ comic-book-like story about IE6. You might wanna check that too…
