Author Archives: author

Drop shadow with CSS for all web browsers

Drop shadow with CSS for all web browsers

Very simple and effective css snippet presented below.

[javascript]

.shadow {
-moz-box-shadow: 3px 3px 4px #000;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */
-ms-filter: &”progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color=’#000000′)&”;
/* For IE 5.5 – 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color=’#000000′);
}

[/javascript]

The shadow is black (#000). If you need another color you should change the #000.

Enjoy it!

JQuery Mobile Framework: How to turn off the Ajax processing the links and form

  	<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
  	
  	    <script type="text/javascript" >

    		$(document).bind("mobileinit", function(){
			$.mobile.ajaxEnabled = false;								
		});

    </script>
    <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>

The order of code inserting is important.
The AJAX disabling code must prior to initializing the mobile framework.

PHP: What does it mean ($$)?

The code and output below.
What’s just happend?

[php]
$tst = &quot;hello&quot;;
$$tst = &quot;test value&quot;;

var_dump( $$tst );
var_dump( $tst );
var_dump ( $hello) ;
die();
[/php]

string(10) "test value" string(5) "hello" string(10) "test value" 

How to reload current page in Javascript

There are 3 ways how to achieve this task.

[javascript]
<input value=’Reload Page’ onclick=’window.location.reload()’ type=’button’ />
[/javascript]

[javascript]
<input value=’Reload Page’ onclick=’history.go(0)’ type=’button’ />
[/javascript]

[javascript]
<input value=’Reload Page’ onclick=window.location.href=window.location.href’ type=’button’ />
[/javascript]

The button click is used to fire the loading. You can assign the event to hyperlink or trigger event by jquery

Using clear rule in css

.clearfix:after { content: "."; visibility: hidden; display: block; height: 0; clear: both; }

Usage

<div class='.clearfix'>
	Some content
</div>

Bonus:

In css :

.clear { clear: both; }
<br class='clear' />

Prompt Usage

Prompt usage snippet

			var track_number = prompt("Please enter tracking number:");
			if(track_number)
			{
				$(this).data('track_number', track_number);
				//$(this).closest('tr').children().eq(4).append('<div style="color:red; display:block;text-align: center;">[' + track_number + ']</div>');
			}
			else
			{ 
				/* do something else */
			}