Archive for the Category: ' jQuery '

14 Feb 2010 @ 11:37 PM 

Greetings

This is another short and sweet posts, basically it involves using the Math. function to do some nifty tricks

Lets say that you want to get a random number between 1 and 10 and you dont know how. Well the answer is quite easy and it involves combining 2 Math. functions. Math.floor() and Math.random().

Math.random()

This function takes a random number between 0 and 1

Math.floor()

This function rounds a number down to it’s smaller number, for example. 4.4 would become 4, 4.6 would become 4 as well, -4.1 would become -5 as well as -4.6 would become -5 as well.

+ Continue Reading This Article

Posted By: Dinulescu Alexandru Adrian

Last Edit: 14 Feb 2010 @ 11:37 PM

EmailPermalinkComments (0)

25 Jan 2010 @ 6:42 PM 

JQuery Negation

 if(!$(stuff).length > 5){
   // If element ISNT LARGER THAN 5 so in our case the number of elements must be 0 1 2 3 4 and 5
  $(this).doSomething();
}
else {
 // The number of elements is GRATER THAN 5 // do another thing
}

Basically this is a negation of the following, god damnit my head hurts

 if($(stuff).length < 5){
 $(this).doSomething();
}
else {
 $(this).doAnotherThing();
}

Oh well new day, new learned things. God Bless Amerika

Tags

Tags: , ,

Categories: jQuery

Posted By: Dinulescu Alexandru Adrian

Last Edit: 09 Dec 2010 @ 02:04 PM

EmailPermalinkComments (0)

25 Jan 2010 @ 6:19 PM 

Hello

This post is going to be short and sweet. Basically jQuery 1.4 launched a couple of days ago and i thought i’d move my blog from 1.3.2 to 1.4 and lo and behold JS Error.

I was going like WTF, and after trying to debug it for like 15mins i come to the following conclusion. From my own personal experience, in jQuery 1.3.2 when you wanted something to happen to an element you went like this. Since i use WordPress for as my blogging platform not everytime the .elementClass element was present.

+ Continue Reading This Article

Posted By: Dinulescu Alexandru Adrian

Last Edit: 25 Jan 2010 @ 06:19 PM

EmailPermalinkComments (0)

28 Dec 2009 @ 6:28 PM 

Hello

After working on the google shortcuts for a while, i decided to open up IE 8 and see if the application works or not. I was surprised and started to do the old alert("hax") thing every dozen lines. The problem is with the $(window).keypress(function(e){}). It seems that IE doesnt understand at all the $(window) property at all when it comes with keypress/keydown/keyup events.

+ Continue Reading This Article

Tags

Tags: , ,

Categories: IE6 Bugs, jQuery

Posted By: Dinulescu Alexandru Adrian

Last Edit: 07 Jan 2010 @ 06:17 PM

EmailPermalinkComments (0)

28 Nov 2009 @ 3:17 PM 

Hello

In this post I will elaborate and add more functionality to a previous post of mine found here here. Basically i have added more functionality to the page, such as left / right key navigation, number key functionality, enter/escape key functionality, and of course the entire suite of conditions needed so the code works properly.

I have tried to build each functionality as a module, which you can add and remove, however in order to have the search function work well with the tab functionality and switching, then some interdependence was needed.

the XHTML

The XHTML is not different from the last version, the only thing different is a few bits and pieces of additions, and more importantly a couple of new lists so we can have a tab functionality. Other than that, there were no major changes.

the CSS

As with the first version this CSS is very basic however you can style it as you wish, probably in the future i may add some nicer styles to the project but for now, since it’s just a tutorial thingy, i think what we have is quite enough.

the JS

The JS suffered major changes, (of course right, we’re building a JS application here). It is kinda hard to explain everything in the post, but all the lines (almost all the lines) are heavily commented within the JS file itself, so please refer to that file for exact instructions and explanations.

The files can also be found online Here and a zip file can be downloaded from here

In part 3 of the series i will try to enlarge the search possiblity to include more than 1 letter

Tags

Tags: , ,

Categories: jQuery, XHTML/CSS

Posted By: Dinulescu Alexandru Adrian

Last Edit: 08 Jan 2010 @ 09:10 PM

EmailPermalinkComments (0)