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().
This function takes a random number between 0 and 1
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.
Tags: Javascript, Javascript comparing numbers
Categories: Javascript, jQuery
Posted By: Dinulescu Alexandru Adrian
Last Edit: 14 Feb 2010 @ 11:37 PM
JQuery Negation
Basically this is a negation of the following, god damnit my head hurts
Oh well new day, new learned things. God Bless Amerika
Tags: Javascript, jQuery, Nerd Rage
Categories: jQuery
Posted By: Dinulescu Alexandru Adrian
Last Edit: 09 Dec 2010 @ 02:04 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.
Tags: InanisMOD Theme, Javascript, jQuery 1.4, jQuery Bugs
Categories: Javascript, jQuery
Posted By: Dinulescu Alexandru Adrian
Last Edit: 25 Jan 2010 @ 06:19 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.
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 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.
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 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
Recent Comments