Posts Tagged ‘jquery’

jQuery + CSS3 rotating panel

January 17th, 2012 No comments

This is just a small proof of concept (so don’t blame me for the lame CSS I created. ;)).
I found out it can be done nicer. (Read this awesome article about flip effects) I only do 90 degree rotations on the Y-axis and do no backside-hiding.

The idea is that a visible panel is seemingly rotated and the backside becomes visible. This works by using transition events. The 1st panel is visible at start and the 2nd panel is hidden. Then when an event is triggered (Hovered in this example) the 1st panel will be rotated 90 degrees (y-axis). The panel is then invisible the animation is ended and an event is triggered. At that point the 2nd panel is made visible and an class is added to trigger to animate it from 90 degrees back to 0 degrees. Thus creating an animation which makes it seem like the panel was completely rotated.

The implementation is currently only working for webkit based browsers.

	<style type="text/css"> 
		    -webkit-transition: -webkit-transform 0.5s ease-in;
		    -webkit-transform: rotateY(90deg);
		    -webkit-transition: -webkit-transform 0.5s ease-in;
		    -webkit-transform: rotateY(90deg);
		    -webkit-transform: rotateY(0deg);
	<script type="text/javascript" src=""></script>
	<script type="text/javascript">
			function( event ) {
			}, false );
	<p><b>Note:</b> This example does not work in Internet Explorer.</p>
	<div id="slide1">Test</div>
	<div id="slide2" style="display: none;">Awesome</div>
	<p>Hover over the div element above, to see the transition effect.</p>
Categories: Coding Tags: , , , , ,

jQuery fancybox with ajax content.

October 1st, 2010 1 comment

There are several ways to do this I guess. What I wanted was a default css class which I could apply to an anchor tag and have a specific part of the content loaded in fancybox. This is what I came up with. It is also possible to do this with the ajax property of fancybox itself I suppose.

$(function () {
        function (event) {
            var url = jQuery(this).attr("href");
                function (data) {
                    var content = jQuery(data).find("#content");
Categories: jQuery Tags: , ,

Greasemonkey + jQuery = 1337

July 30th, 2010 No comments

Got some inspiration from this site for the base script: click

I wanted a site to always show the answer ‘Ja’ (Dutch for yes). Which was normally only shown at a specific time. (The question was if you could start drinking beer. ;))

Here is the full script:

// ==UserScript==
// @name           ishetalbiertijd.user.js
// @namespace
// @include*
// ==/UserScript==
var $;
// Add jQuery
	if (typeof unsafeWindow.jQuery == 'undefined') {
		var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement,
			GM_JQ = document.createElement('script');
		GM_JQ.src = '';
		GM_JQ.type = 'text/javascript';
		GM_JQ.async = true;
		GM_Head.insertBefore(GM_JQ, GM_Head.firstChild);
// Check if jQuery's loaded
function GM_wait() {
	if (typeof unsafeWindow.jQuery == 'undefined') {
		window.setTimeout(GM_wait, 100);
	} else {
		$ = unsafeWindow.jQuery.noConflict(true);
// All your GM code must be inside this function
function letsJQuery() {
	//@require does not work for us...
	$('#datum').replaceWith('<span style="font-size: 200%; font-weight:bold; color:white">Het kan nu!</span>');
Categories: Coding Tags: ,