Netshine Software Limited







Home arrow Developer Blog Make Text BiggerMake Text SmallerReset Text Size
Category >> Javascript

Aug 10
2009

Background always transparent in OverLib

Posted by netshine in transparenttooltipstemplateOverLibjoomla 1.5joomlaJavascriptcsscolourcolorbackground

I just spent an infuriating hour trying to work out why the tooltips output by nBill, using OverLib, were always coming out with a transparent background - even if I explicitly specified a background colour when calling OverLib. I tried sending commands in the call to OverLib and setting the javascript variable, but the commands were just ignored.

It seems the solution lies in your template's CSS file...

Jun 04
2009

keydown, keyup, keypress not fired on non-input elements

Posted by netshine in onkeyuponkeypressonkeydownkeyupkeypresskeydownJavascripthtmlformsfocusfiredeventcross browsercapture

If you want to capture one of the above events in javascript, in most cases, it will be on an input element (eg. a text box). But what if you want to capture a keypress anywhere on a document (eg. to delete a highlighted element from the page when the delete key is pressed, which is what I was trying to do)? I tried adding onkeydown to the body tag, but it would only fire in IE. Firefox, Safari, Chrome, and Opera all failed to fire the event unless I first clicked on a text box. But there is a way to do it...

Apr 08
2009

XPLike.Plesk meets Joomla 1.5

Posted by netshine in xpliketemplatetablelesssearch engine friendlypleskPHPjoomla 1.5joomlaJavascripthtmlgplfree

I finally got round to re-writing the xplike.plesk template to work with Joomla 1.5. The original xplike.plesk template was written by SWSoft (now known as Parallels - the makers of Plesk), and released under the GPL for Mambo 4.5.0. I tweaked it to work on Mambo 4.5.1, and Joomla 1.0, and it proved very popular. As I did not write the template (just modified it), it was difficult for me to provide support for it. It also did not escape my notice that the code in the template was heavyweight and ugly (although the design itself is great).

So, I re-wrote the whole thing from scratch for Joomla 1.5. The result is much improved - a very lightweight, standards-compliant, accessible, search-engine-friendly, tableless template, with collapsible menus (that 'remember' your preferences if you re-visit the site within 30 days), a resizable header area (lots of people wanted a custom-sized header so that their company logo would fit), and a choice of 3 colour schemes.

For more information, and to download, visit: http://www.netshinehosting.com/home-page/free-joomla-1.5-templates.html

Dec 10
2008

Capturing content from nicEdit when form is submitted by Javascript

Posted by netshine in wysiwygonsubmitnicEditJavascripthtmlforms

nicEdit is a very lightweight wysiwyg HTML editor, distributed under the MIT license (which means that as long as the copyright info remains intact, you can do pretty much anything with it, including distribute it with a commercial application). There are a couple of drawbacks to nicEdit - first, it does not produce standards compliant HTML. If it did, it would not be anywhere near as lightweight, so that's a bit of a tradeoff (it relies on the browser's own HTML editing features, so if you use a decent browser you should get pretty good results). The other main problem I found though, is that if you have a form containing a nicEdit editor, and submit the form using Javascript ie. form.submit(), the content of the editor is not posted back to the server!

If you would like to know why that is, and what you can do about it, read on...

Oct 29
2008

Rounding Numbers in Javascript

Posted by netshine in roundingJavascriptfloatdecimal places

Javascript is incapable of rounding numbers to a certain number of decimal places accurately. The problem occurs because Javascript treats decimal numbers as floats, which, as most programmers know, are a pain in the proverbial. As such, if you try to round a number like 0.285 using Javascript (using either Math.round or the toFixed function) you end up with 0.28 instead of 0.29. After a half-hearted search on google, I could not easily find a sample script that I could use in nBill to calculate this accurately (because nBill is commercial, and the only sample I found would not allow me to use it for commercial purposes). So I wrote my own function from scratch...

Joomla! Tutorial
Take a look at our free tutorial for Joomla! Administrator...


Login Form





Lost Password?

© 2004-2010 Netshine Software Limited   Terms and Conditions