How to clear all CSS style defined in the attribute of an element?


I had a couple of div's that show their CSS styles according to an imported css file. However, during Javascript manipulation using jQuery, a lot of styles are attached in the 'style' attribute of the div and the latter overrides the CSS defined in imported file.

I wanted to clear all those styles defined as an attribute. The easiest way is to simply use the '*' as a means to choose all defined styles and set them all to an empty value of ''. Example:

 $('#myElem').attr('style', ''); //Select all '*' css styles defined as an attribute of #myElem's and set them to an empty value

 I was about to write a for-loop when I thought about this nifty solution.

 

NOTE: In case you're wondering what Javascript notation is that; I am using jQuery library. A similar method should be available in other Javascript Frameworks like prototype.




How to create Virtual Console Games demos for the Wii


I know that it's impossible to make demos of an old game by altering the original source code and create a separate "demo" version. Who knows if the game's source code is available anymore!

Well that was Nintendo's excuse for not offering playable demos of their Virtual Console games on the Wii. But I have a simple quick solution: Time-limit the virtual consol game. You get like 3 minutes to play the full thing before the emulator automatically closes the game on you.

Some could argue that people can avoid the time limit by playing endless 3 minutes. Well that can be counterattacked by simply putting 15 minutes of annoying delay before you play the same game's demo again. Why do you people have to be soo evil?

Other's could add that the same evil people may save the game progress to start from where they stopped last time the demo was played. Well a person with such patience deserves a reward ;)  But a simple counter solution is to disable storing any state data. Storing data should be available in the full game.

 

I would also suggest that downloaded demos shouldn't be deleted upon the end of the 3 minute time frame. It should be stored instead and not deleted just in case the person decides to play the demo one more time before they purchase the game from the Wii Shop Channel.

 

I believe that making playable demos available will give an answer to those doubtful person like me who just can't know how will it be like playing an old game with the Wiimote.

 

Please Nintendo guys, the masters and geniuses behind the best console on earth ever created......please make us play demo games!! please please please :)

 

I just want to re-live the old glorious days...




Flickr

Oroba Tunnel in Salah Salem Road [Cairo]  [NOT HDR]

Subscribe

RSS Feed
Add to Technorati Favorites
AddThis Feed Button


Subscribe by Email


Search

About Me

AA. I am Mohamed Salem Korayem. I work as an Embedded Software Engineer in a major international automotive supplier company here in Cairo, Egypt.

Currently I work in the Tooling Dept. where I, and the rest of the team, strive to make our fellow embedded software geeks happier. I work mainly with the .NET 2.0 using C#.

I also have a big appetite for web-development. I like analyzing the revolution of the web (aka Web 2.0) and how it affects people's lives in return. I develop web-apps with ASP.NET 2.0/Python in my free time. For client-side stuff, I use jQuery for all that Javascript magic.

What I muse, I share on this blog. So enjoy reading my mind and in case you like what you read, kindly subscribe by either email or RSS.

Email me!


Calendar

<<  September 2008  >>
MoTuWeThFrSaSu
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

View posts in large calendar

Archive

Tags

Categories

Blogroll

OPML fileOPML

PersonalLinks



page counter Directory of Computers/Tech Blogs

Sign in