oops i broke the build lol

Increasing drag/drop performance with iframes, images, and forms

If you’re using YUI, Prototype, or MooTools and you’re building an application that involves draggable components containing iframes, images, and/or forms, here’s a quick tip to maximize performance during the onDrag event.

Here is a code snippet of basic markup that’ll represent our draggable component.

<div class="moduleContainer">
	<div class="moduleHead">Draggable Title</div>
	<div class="moduleBody">Draggable Content</div>
</div>

Inside your moduleBody, you could have a plethora of component types, but let’s primarily focus on more complex and performance-taxing ones: forms, iframes, images, and embeds.

Within your startDrag event, you can define the following:

var $$ = YAHOO.util.Selector.query;
var elGroup = $$('div.moduleContainer form, div.moduleContainer iframe, div.moduleContainer img, div.moduleContainer embed');

for(var i = 0, len = elGroup.length; i < len; i++) {
    elGroup[i].style.visibility = "hidden";
    //You would need to set it back to visible on your endDrag event.
}

The reason why we set the element's visiblity property to hidden is because an element will not receive events if it is hidden. During your onDrag(e) event, you'll notice that every time the element reaches a pixel threshold (usually every 3 pixels), it will invoke the onDrag event. This can get quite taxing while you're dragging the component around on the viewport. Users will definitely notice the lag.

The reason I only apply this selector to the 4 tags is because of their inherent complex functionality. Iframes have the ability to include content from a source, where as, spans or paragraphs are simply text. When the onDrag event is invoked, I ran into several problems where every time the component would meet a pixel threshold, the iframe would reload its src attribute. Spans, headers, and paragraphs won't tax your application's performance during a drag interaction.

RockBand Drums Adventures

If you’re just as addicted to RockBand as I am, you’ve probably YouTube’d videos of people drumming. I’ve found a few that were produced by the same guy, but this guy’s insane at the drums.

AzuriteReaction doing Metallica -…And Justice For All

AzuriteReaction doing Metallica – Ride The Lightning

AzuriteReaction doing Yeah Yeah Yeahs – Maps

The info panel on all his videos say he’s one of the top on the leaderboards on XBox Live–I don’t disagree with that, he’s got insane skills.

Rockband is a sweet game.

Rockband
Go out and buy it. It is so awesome.

Back from Puerto Vallarta

I feel refreshed.

Impark Parking Corporation — Falsely Accuses The Innocent..Again.

So, have you ever arrived at your car to see a parking ticket for $68 on your windshield and you pull out your Proof of Payment stating that you paid for parking on that particular stall? I have. After doing some massive research on Impark, I’ve found a discussion topic on the Discover Vancouver forum stating that he’s had the same problem that I have just encountered.

Check this out:
Impark Parking Ticket and Proof of Payment

You’ll notice that my Stall# is 448–and the stall #’s on the Proof of Payment + Parking Ticket match. You’ll also notice that I have VALID parking until 2AM January 3. You’ll also notice that I paid at 9:45AM on January 2, 2008. This is the second time I’ve been falsely accused of not paying for parking. The funny thing is, it’s the same Patroller that issued both these parking tickets.

Is Impark trying to scam me? Do they honestly assume that I don’t keep Proof of Payment for Parking, VISA records, etc? I always pay with VISA–which is awesome because I can just log into my Online Banking to pull up all my transactions.

Also, when you try to dispute these parking tickets, it’s so hard to find the proper phone # on their website. It’s like they’re purposely hiding it.

Has Impark ever tried to pull this on you, as well? Do tell your story. From what I can tell from Googling Impark, there’s a lot of cases out there where they’ve tried to falsely accuse people for not paying for parking. So, please, do tell your story!

Jaime Bueza's Blog is powered by WordPress

Valid xhtml

Clicky Web Analytics