jQuery Accordian

7 3 29th 2009 § 0 comments § permalink

I didn’t like what I saw, when I went looking… so I kinda made my own.

$(document).ready(function()
{
	// activete the first item
	$(".accordion .query:#news").animate({height: 470}, 750);
	// drop the active text
	$(".accordion .query:#news").find(".activate").animate({opacity: "0", top: 450},760);

	$(".accordion .query").click( function()
	{
		// grow!
		$(this).animate({height: 470}, 750);
		//
		$(this).find(".activate").animate({opacity: "0", top: 450},760);
		// this is how I will set the id of the expanded swf
		var a = $(this).attr('id');
		//alert( a ) ;
		// truncate the non active bastards
		$(this).siblings(".query").animate({height: 150}, 750);
		//
		$(this).siblings(".query").find(".activate").animate({opacity: "1",top: 130},760);
	});
});

→ Surrender.

Fun with KeyPress

7 3 29th 2009 § 0 comments § permalink

Keypress in AS3:

// alert back keys that are pressed
addEventListener( KeyboardEvent.KEY_DOWN, keyHandler );
// key press alert
function keyHandler( e:KeyboardEvent ):void
{
	trace("[ " + e.keyCode  + " ]");
}

For the same thing in AS2:

var keyListener:Object = new Object ();
keyListener.onKeyUp = function()
{
 trace ( "Key: " + Key.getCode() );
};
Key.addListener (keyListener);

This looked a lot cooler before I trimmed it down for the post.

External Interface of the devil

7 3 29th 2009 § 1 comment § permalink

I’m not a fan of ExternalInterface, but it is good to have in your pocket.
I have another post for AS2 External Interface [ here ]…

<script language="JavaScript">
	var jsReady = true;

	function thisMovie(movieName) {
		 if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	}

	//-- is EXT INT ready?
	function EXactive()
	{
		return jsReady;
	}
	//-- fetch id
	function GetID()
	{
		return thisMovie("ExternalInterfaceExample");
	}
</script>

→ Click this.

Where am I?

You are currently viewing the archives for 7 3 29th 2009 at DrPunchBlog.

  •  

    July 2009
    M T W T F S S
    « Apr   Aug »
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Archives

  • The Uber-Mannerist ...
    By Van Arno
  • RSS mtr.me

  • Translator