You are hereUser interface

User interface


JQuery, Javascript and CSS tips, tricks and hacks

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. Then you just change what is needed and after all is done just confim on FileZilla that you want to upload changes.

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. But all you need to do is put under performance, CSS to optimize and you will have one stylesheet and will have this problem fixed.

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

You can specify that a set of CSS rules apply only when the screen is smaller than a certain resolution:

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

<script type="text/javascript">
 function toggleDescription(itemId) {
 $('#subject').val(itemId);
 window.alert( $('#subject').val() );
 }
</script>