Tag Archives: JavaScript

In jQuery you have multiple selectors to either select single objects or a whole bunch. I needed to select an image by its alt tag, and guess what, there is also a selector for alt tags. You need to do the following:

$(‘img[alt=”My Alt Image”]’)

I needed this so that I could change the class and set the selected image as active, by searching the alt tag as below:

$(‘img[alt=”My Alt Image”]’).addClass(‘.active’);

Something else that might be useful is to revert the active image, to a normal image. Instead of using the alt tag this time you can use the ‘active’ class selector as below:

Update 2011: For those people who had problems with the below instructions.. please find in on my website here. And when you’re there take a look at my site and see what you think about it 🙂

Lightbox 2 has the functionality to set maximum width and height. But what about previous versions? To set the maximum image width and height for lightbox (version 0.5) you need to do some extra coding yourself. Open the jquery.lightbox-0.5.js file and search for the next pieces of code (in bold below):

settings = jQuery.extend({
maxWidth: null,
maxHeight: null,
...

Then search for the next function (in bold) and write copy and paste the code underneath it: Continue reading

Instead of using the “<a href=” tag to go to another page, you can use the “<div onclick=” to be transferred to another page. This is extremely useful if you have a lot of text and pictures that need to be clicked anywhere wanted. Next is the html code to achieve this:

Finally the day has come, for Malta to experience a new concept in web development on www.nine.com.mt. Today we just made our first advert on the timesofmalta.com as till now is going very good.

Clients will have many features for a small price. Stay tuned as we’re going to reveal more before Monday!

Why the word Project?

We chose the word project instead of concept or design for the simple fact that this website will be always evolving. There are so many things that we have ready for it. And we are the type of persons that listen.

Why Nine?

We chose the number Nine as it is a magic number. It’s amazing what Try this…

– Multiply any number by nine (be it 10, or 15, or thousands or millions).

– Then repeatedly add the digits of the resulting number until it is just one digit

The substring() method extracts the characters from a string, between two specified indices, and returns the new sub string. This method extracts the characters in a string between “from” and “to”, not including “to” itself. Continue reading

No, this post is not about dieting or anything like that… but to remove Special Kharacters. To do this, I was going to use a for loop in javascript that checks each character and if it is not between ‘A’ and ‘Z’, the character will be removed. Until I found this code lying around on the net which makes removing special characters very simple…