JQuery, Javascript and CSS tips, tricks and hacks

Hiding History in User profile view

This option of showing user history seems more obsolite then useful, se lets hide it.

For Drupal 6, copy this file from your /sites/modules/user directory:
user-profile-category.tpl.php, put the copy into your custom theme directory and within that file, replace the code with this

CKEditor and IMCE file button

You installed your CKEditor and IMCE but there is only image dialogue on your node edit screen and you want to add plain file link.

Fastest way to edit files, change CSS etc

Fastest way i found to make small changes on your site is to use FTP program like FileZilla. Then you just go to file you want to edit and click view/edit. File is downloaded locally and opened in your default (or the one you set in FileZilla) editor.

Lightbox2, hiding flash content

Having problem with Flash when using lightbox for overlay? Just add transparency to those flash embed codes and they will be in the dark.

<param name="wmode" value="transparent" />
<EMBED src="swf.swf" quality=best bgcolor=#FFFFFF wmode="transparent" WIDTH="550" ...

IE stylesheet Limit

There is a "31 stylesheet limit in IE 6 & 7" so sometimes your page will break in this browsers. You will go crayze, asking yourself whats going and, checking CSS and tags.

CSS for iphone

When you decide to make page for iphone, or maybe just make additional css to change how its views on iphone you should add this code, as iphones ignore other code. With this you set it depending on the size of the screen, so you hide sidebar for all devices that have screen smalled than 480px (widescreen iphone format). More info can be found on linke below

Setting a form value with jQuery

If you want to select form value, for example hidden field for subject in mail form you can set the form values with jQuery using the val() function.

If the form element is <input id="subject" name="subject" type="hidden" value="someweb.com" /> you set it with  $('#subject').val(itemId);

so put it in function