Thursday, December 6, 2007

Div tag in html

Well, this topic might sound easy but when I and my colleague searched in the net for one of the scenario under this topic,we could not find an easy solution to it.


Now let me describe the scenario:

Consider the image at the right side. Here the first rectangle is the screen. And your webpage size is lesser than the screen. That is it occupies half of the screen. There are spaces on both left and right side of the webpage size. In simpler words, if the screen size is 1024*768, the webpage width is only 862.

Also consider there are 4 menus in the webpage namely A,B,C and D as given in picture.And each menu has its own drop-down menus. This drop-down menus expand and collapse on mouse over and mouse out respectively.

Here the main menu A,B,C and D and drop-down are seperate div.And the div position for the drop-down menu is absolute.

Like in the figure, the last menu's drop-down list goes out of the webpage size limit thus occupying some space in the screen width. To make it come inside the webpage size,we tried a lot of stuffs which didnt work. Finally we came to the below conclusion.

First thing is that we can position the div element to the corresponding place. But when the menus are dynamic we have to find out another solution but with respect to positioning the div.

There is an property in div called div.style.right which has value 0 and 1. 0 means the style of the div becomes right aligned.

Now if we give this, the div will be right aligned to for all the menus. But what we want to achieve is not that rather only for the menu D.

There is another property in html called offset,right? Remember? Wont this be useful to achieve our purpose? Yes, ofcourse it will. Now lets c how we need to use this.

Offset has certain property associated.

offsetParent - is the screen size

offsetWidth - gives the width of the specified object

offsetLeft - Retrieves the left edge of the specified object

offsetRight can be calculated by the sum of left and width

Now,what we need to check is if the div goes beyond right side of the screen, we have to make it to align to right.

var screenRight = div.offsetParent.offsetWidth;


var divRight = div.offsetLeft + div.offsetWidth;


if(divRight > screenRight)
div.style.right =0;

This 3 lines will make the drop-down align to the right of the webpage(i.e. div).

Now this solves the problem.

Tuesday, June 5, 2007

Apple iPhone Coming on June 29th

Hey guys,

For all the iPhone lovers, Its releasing on June 29th. Of course, not in India..... ;) I found the TV Ads in the site and the phone looks really good.... Man, is it a Phone or something else??? I wonder how they would have struggled to come up with phone....

The links are: link1 link2 link3


Specifications and Features :
  • black on the front and silver on the back
  • quad-band GSM/EDGE
  • 3.5-inch wide touch-screen display and 11.6 mm thick
  • 2 megapixel camera on the back
  • speaker, microphone
  • iPod dock connector on the bottom
  • a ring/silent switch and volume controls on one side
  • Home Button
  • light sensor which controls screen brightness to save power
  • a proximity sensor tells the iPhone turn off the touch screen when you bring it to your ear
  • an accellerometer automatically switches the iPhone to portrait or landscape mode, depending on how you're holding the device
  • runs on a slimmed down version of Mac OS X which includes Wi-Fi, Bluetooth 2.0
  • ability to switch from cellular to WLAN technology
  • Visual Voicemail (developed by AT & T) allows listing of voice mails etc which are related to voice. (Check at the end of the TV Ads, you will see the commercial ending with "Only on the new AT & T".
  • Safari Web browser
Additional Features:

Merge calls for Conference, i-Chat, Zoom in and out of pictures, PC and MAC synchronization,Yahoo! push email support, MAC OS Dashboard widgets.

Some of the features are same like ipod. U can connect it to the system and the files can be transferred to computer. Calendar, Notes, Bookmarks, Contact information are retain the same in iPhone also.

Oh, the 3rd TV commercial is awesome right??? Google maps showing the place and information and u can call also to that number...

Simply putting, its a merge of 3 widgets : Mobile Phone + Internet + iPod with touch control.

Ok guys, I guess Indians have to wait for some months for it to come to India so that we can have a look at it... ;)

Friday, April 20, 2007

No PowerPoint? Google will offer a free alternative

Its been only google's products in my blog..... Here comes yet another one.....

Google is adding another tool in its battle with Microsoft: A free version of presentation software.

The yet-to-be-named software will be included in Google Apps, an online suite that includes free word processing, spreadsheet and calendar programs. Users will work with the program online but will be able to save files and view them offline. It's expected to be available this summer.

The Google CEO says its not a competition to Microsoft. Check what he has said:

"We believe we can bring presentations to a new level of user satisfaction.We don't think it competes with Microsoft, because it doesn't have all the functionality of Office. It's a different way of sharing information, more casual, and a better fit to how people use the Web."

Google announced a deal to buy online ad firm DoubleClick for $3.1 billion, which Microsoft contends violates antitrust rules. The deal is Google's biggest ever, following its $1.6 billion acquisition of video-sharing site YouTube last year.

Also, Google announced an alliance with radio broadcaster Clear Channel that lets users of Google's online advertising network buy radio ads directly from their computer.

Google is inspiring me a lot nowadays man!!! Awesome company....

Yipee! Google Spreadsheets get charts

Google Spreadsheets will take a new shape which will have charts also as an option.

Here are the new spreadsheet features of Google Spreadsheet:

Named ranges: you can define a name for a range of cells, and use this name in formulas to refer to cells, for example write =sum(expenses) instead of =sum(c12:e17). This helps make calculation logic clearer to write and understand. Check it out under the "Formulas" tab.

Cell comments: Attach comments to individual cells, great for additional information or for collaboration on a single cell.

Bi-directional text: The ability to properly view and edit text in right-to-left languages like Hebrew. This is very important for our local community here in Israel.

A quick way to duplicate a sheet.

A new right-click option to search the web for the text in a cell.

Google Rebrands Froogle, Adds Personalization Features

Froogle has been losing traffic steadily for the last four months, so the company is rebranding it with the straightforward name Google Product Search.

Google's shopping search service Froogle proved more bemusing than amusing. In an effort to bewitch rather than bewilder, Google rechristened its product search service with the decidedly straightforward name Google Product Search.

Google recently also rolled out two new features to further personalize search for those with Google accounts who have enabled their Search History.

The first is a recommendation button on the Google Toolbar, which many users have installed in their Web browser. When clicked on, the button, which shows a pair of dice, takes the user to a site calculated to be of interest based on past searches. Google says it will generate up to 50 such sites per day.

This feature is similar to a service called StumbleUpon, that eBay is rumored to be acquiring. StumbleUpon's recommendations are based on user profiles and voting, in contrast to Google's automated, algorithmic approach.

The second new Google personalization feature is the ability to add a recommendations tab to a Google Personalized Homepage. These recommendations are similar to the Google Toolbar recommendations.

Way to go GOOGLE!!!

Friday, March 30, 2007

Repartition your hard disk on-the-fly with Windows Vista

As you know, the Disk Management console tool in Windows XP will allow you to create a new partition using any unallocated, or free, space on a hard disk. However, if there is a single partition that takes up the entire hard disk, you can't use the Disk Management console tool to repartition the hard disk into two or more smaller partitions. If you want to accomplish this task in Windows XP, you will have to invest in a third-party console tool such as PartitionMagic. Of course you can back up the disk, reboot with a DOS startup disk, and then use DOS FDisk command to repartition the disk, but then you'll have to reformat and reinstall, which is a lot of work.

Fortunately, Windows Vista's Disk Management console tool will allow you to repartition your existing hard disk any way you want. In other words, it will now allow you to shrink, extend, create, and format partitions without putting your data in jeopardy. Of course, before you perform any of these operations, you should back up, just in case.

Click http://articles.techrepublic.com.com/5100-10877_11-6170510.html?tag=nl.e132to know how to repartition step by step