Thursday, August 1, 2013

JavaScript arrayunshift

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.unshift("Kiwi") + "<br />");
document.write(fruits.unshift("Lemon","Pineapple") + "<br />");
document.write(fruits);

</script>

<p><b>Note:</b> The unshift() method does not work properly in Internet Explorer, it only returns undefined!</p>

</body>
</html>
Result

JavaScript array to String

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.toString());

</script>

</body>
</html>

Result


JavaScript arraysplice

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write("Removed: " + fruits.splice(2,0,"Lemon") + "<br />");
document.write(fruits);

</script>

</body>
</html>
Result

JavaScript arraysort Number_02

<html>
<body>

<script type="text/javascript">

function sortNumber(a, b)
{
return b - a;
}

var n = ["10", "5", "40", "25", "100", "1"];
document.write(n.sort(sortNumber));

</script>

</body>
</html>
Result

JavaScript arraysort Number

<html>
<body>

<script type="text/javascript">

function sortNumber(a, b)
{
return a - b;
}

var n = ["10", "5", "40", "25", "100", "1"];
document.write(n.sort(sortNumber));

</script>

</body>
</html>
 Result

JavaScript arraysort

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.sort());

</script>

</body>
</html>

Result

 

JavaScript arrayslice

array_slice:

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.slice(0,1) + "<br />");
document.write(fruits.slice(1) + "<br />");
document.write(fruits.slice(-2) + "<br />");
document.write(fruits);

</script>

</body>
</html>

Result


JavaScript arrayshift

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.shift() + "<br />");
document.write(fruits + "<br />");
document.write(fruits.shift() + "<br />");
document.write(fruits);

</script>

</body>
</html>
Result

JavaScript arrayreverse

<html><body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.reverse());

</script>

</body>
</html>
Result

JavaScript arraypush

<html><body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.push("Kiwi") + "<br />");
document.write(fruits.push("Lemon","Pineapple") + "<br />");
document.write(fruits);

</script>

</body>
</html>
Result

JavaScript arraypop

<html><body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.pop() + "<br />");
document.write(fruits + "<br />");
document.write(fruits.pop() + "<br />");
document.write(fruits);

</script>

</body>
</html>
Result

JavaScript Arrayjoin

<html>
<body>

<script type="text/javascript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.join() + "<br />");
document.write(fruits.join("+") + "<br />");
document.write(fruits.join(" and "));

</script>

</body>
</html>
Result

JavaScript arrayconcat 02.

<html><body>

<script type="text/javascript">

var parents = ["Roni", "Sabiha"];
var brothers = ["Rashid", "Nurul", "Badal"];
var children = ["Alam", "Mitu"];
var family = parents.concat(brothers, children);
document.write(family);

</script>

</body>
</html>
Result

JavaScript arrayconcat

<html><body>

<script type="text/javascript">

var parents = ["Roni", "Sabiha"];
var children = ["Alam", "Mitu"];
var family = parents.concat(children);
document.write(family);

</script>

</body>
</html>
Result

JavaScript alert box

<html><head>
<script type="text/javascript">
function show_alert()
{
alert("I am an alert box!");
}
</script>
</head>
<body>

<input type="button" onClick="show_alert()" value="Show alert box" />

</body>
</html>
Result

Wednesday, July 31, 2013

Free Download Adobe Photoshop CS2 Last Verson

Adobe Photoshop CS2
Publisher    Adobe Systems (9)    
O/S       XP/Vista/7/8
Price       Free    
Requirements None
Version     9.0.0    
File Size    348225 K
Last updated Jan 10, 2013

Tuesday, July 30, 2013

Background image position percentence

<html>
<head>
<style type="text/css">
body
{
background-image: url('people.gif');
background-repeat: no-repeat;
background-attachment:fixed;
background-position: 30% 20%;
}
</style>
</head>

<body>

<p><b>Note:</b> For this to work in Firefox and Opera, the background-attachment property must be set to "fixed".</p>

</body>
</html>


Results:


Background image position pixel.

<html>
<head>
<style type="text/css">
body
{
background-image: url('people.gif');
background-repeat: no-repeat;
background-attachment:fixed;
background-position: 50px 100px;
}
</style>
</head>

<body>
<p><b>Note:</b> For this to work in Firefox and Opera, the background-attachment property must be set to "fixed".</p>
</body>
</html>

Result

 


Background image only vertically using

<html>
<head>
<style type="text/css">
body
{
background-image:url('people.gif');
background-repeat:repeat-y;
}
</style>
</head>

<body>
<h1>repeat-y will repeat a background image only vertically.</h1>
</body>
</html>

Result:


Html border color

<html>
<head>
<style type="text/css">
p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}
</style>
</head>
<body>

Result: