My name is Edward Tanguay. I am a web developer in Berlin, Germany. I learn everything I can and record it on this site. Other things you might be looking for: My Ubuntu Tutorial My Datapod Project My Blog Feed:  |  - Code Examples
|
Javascript photo-viewer that works in four browsers
This was a little experiment to get a useful base of cross-browser code that does some interactive stuff in Javascript. It is simple but handles mouseover, button highlight, and just has a nice, basic feel. The only issue is in Opera the text is at top of the buttons, but didn't have any nerves left for that one. At first I tried using :hover and :focus which brought me to the conclusion that this really isn't standard between the browsers so used onmouseover and onmouseout to deal with it. Also worked out a number of quirks that various browsers had, e.g. I removed the ugly dotted focus line in Firefox on the buttons, they left it there in Firefox 3 as well I noticed, I replaced it with a gradient background for the focussed button. So this code looks decent in Firefox 2/3, Internet Explorer 7 (probably 6 too), Opera 9.5 (in fact only after I upgraded from 8 did it show the background on the buttons), and Safari. The bad boy of the group is Opera, but since opera gets embedded in quite a number of devices these days (e.g. Philips TVs), you don't want to leave it out completely. You can view this example online here. Of course next step when implementing this is to make it read from a database or XML file, I just wanted to get the browser-compatibility as accurate as possible first.
| post comment or questionpost comment or question |
|
|
Similar Code Examples:
|
TooTall: just curious why the first set of quotation marks are covered by some letters...and if there is a way to fix this? replyreply post comment or questionpost comment or question |
|
|
|
This code runs in Explorer, Firefox, Opera and Safari, simple code that enables you to attach Javascript functions to button clicks, etc.
post comment or questionpost comment or question |
|
|
JAVASCRIPT CODE EXAMPLE
- added on September 27, 2007
I needed a quick feature on a website which would allow a user to select a date from a popup calendar and have it inserted automatically in a text field in the format 2007-12-31, found Matt Kruse's free script called calendarpopup which I integrated into my site in about 10 minutes. Display the source code, then copy it into a .js file called "thirdParty/calendarPopup/calendarPopup.js", then use the following code to run a sample, then build it into your site.
kalrav: i could not found calender control can you please give me code in php replyreply Anonymous: I want to implement a Calendar on a FORM having formid in JSF replyreply post comment or questionpost comment or question |
|
|
|
JAVASCRIPT CODE EXAMPLE
- added on August 19, 2007
This code plays two different .wav files depending on which link you click. I tested it in IE6 and Firefox2. Works nicely for short files (e.g. pronouncing words on an educational site) or for intranet applications. Explorer will use Windows Media Player and for Firefox you have to install QuickTime, an easy install.
post comment or questionpost comment or question |
|
|
If you need to emulate a button for some reason, this code will get you started. It also flips through an array of texts so if you wanted to make a slideshow of texts or pictures, this would be good base code.
SHOW CODESHOW CODE
post comment or questionpost comment or question |
|
|
Here is a functioning example of some base features you can build into a form with javascript to make it interactive, i.e. fill out other fields as a dropdown item is selected, etc.
Kevin: I'm looking through this but I can't figure out where the data goes when you select your items and hit the 'Send' button  | Wayne Boyd: In this example, the action is set to "" in the line:
<form action="" id="main">
So it doesn't go anywhere or do anything unless you edit it more. | post comment or questionpost comment or question |
|
|
|
This code shows how you can use javascript to make rows in a table light up when moused over and change color when you select them, similar to how phpmyadmin does it.
SHOW CODESHOW CODE
post comment or questionpost comment or question |
|
|
There may be times when you want an event to be first ONLY when a user DOUBLE clicks on a link and not on a simple click. You simply use the ondblclick event. Note however, that everytime a double click is fired, a click is necessarily fired before it.
post comment or questionpost comment or question |
|
|
This shows you how to use the onload event in the body tag to show the current date and time when the user loads the page, nicely formatted as well.
sunita: how to create a calendar in javascript after 2 fields(i.e,bottom)in a table+ tell me code replyreply post comment or questionpost comment or question |
|
|
| My Free Tutorials: How to Install the Android SDK on Windows XP and Create an Application that Runs in the Cell Phone Emulator How to Create a Website with Datapod Install Fedora 6 in VMWare on Windows XP and connect it to your network Install Perl 5 on Windows XP and Get a Perl Hello World Running Install OpenSuse 10.2 in VMWare on Windows XP and connect it to your network Install Ubuntu 7.04 in VMWare on Windows XP and connect it to your network Install Java on Windows XP and Learn the Basics of Java 6 using the NetBeans IDE Setup a PHP Development Environment on Windows XP With Apache, PHP 5, MySQL 5, SQLite, Eclipse, Subversion, PHPMyAdmin, and Datapod Install a PHP Development Environment with Eclipse PDT, Apache 2.2, PHP 5, MySQL 5, and phpMyAdmin Using XAMPP Lite How to Install Ruby on Rails with Instant Rails and Create a Website Using JEdit and the Ruby Plugin  |