Simple Page Peel Effect with jQuery & CSS

You have probably seen these forms of advertisings where you can peel a corner of a website and see a message underneath. It seems most are flash driven, but I decided to try it out using some simple lines of jQuery.

1. HTML – Page Peel Wireframe

The “pageflip” div will act as the container, mainly used to establish the relative positioning. Then nest the image and the span class of “msg_block” wrapped in an <a> tag.

Note – If you don’t have any conflicting absolute/relative positioning properties, you technically don’t need the “pageflip” container at all.

<div id="pageflip">
	<a href="#">
		<img src="page_flip.png" alt="" />
		<span class="msg_block">Subscribe via RSS</span>
	</a>
</div>

2. CSS – Page Peel Styles

Set the image property to a smaller size (50px by 50px) by default and set the absolute positioning to be in the top right corner. The image will be used similar to the “masking” technique in Photoshop or Flash, where it will be placed on top of the hidden message, so only a portion of the message will be shown. Check out the image below for a visual:

The actual message behind the “peeling” effect, is all within the “msg_block” class. By default, it will start at 50px by 50px, positioned on the top right corner of the page. The text-indent will shoot the text off of the page for anyone with CSS enabled.

#pageflip {
	position: relative;
}
#pageflip img {
	width: 50px; height: 52px;
	z-index: 99;
	position: absolute;
	right: 0; top: 0;
	-ms-interpolation-mode: bicubic;
}
#pageflip .msg_block {
	width: 50px; height: 50px;
	position: absolute;
	z-index: 50;
	right: 0; top: 0;
	background: url(subscribe.png) no-repeat right top;
	text-indent: -9999px;
}

Note that the “msg_block” height is off by 2px compared to the image property – this is taking in consideration of the drop shadow that the image has.

3. jQuery – Animating Page Peel

All we are doing here is expanding the image and msg_block on hover, then retracting to its default size on hover out.

$("#pageflip").hover(function() { //On hover...
	$("#pageflip img , .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
			width: '307px',
			height: '319px'
		}, 500);
	} , function() {
	$("#pageflip img").stop() //On hover out, go back to original size 50x52
		.animate({
			width: '50px',
			height: '52px'
		}, 220);
	$(".msg_block").stop() //On hover out, go back to original size 50x50
		.animate({
			width: '50px',
			height: '50px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
});

15 Really Cool And Sexy Free RSS Feed Icons

We know that a cool and sexy RSS icon will attract more readers to subscribe to your blog and there are hundreds of posts around the internet discussing about free RSS feed icons. Reading these posts will consume a lot of time. So, WDB team had gone through these posts and picked 15 free RSS feed icon sets that are really cool and sexy.

1) RSS icons by sniffels [Read more...]

27+ Useful Javascript Tab Navigation Scripts

There are a lot of different ways to implement tabs in our website. I had seen pure CSS implementation, Javascript implementation such as jQuery and MooTools tabs. Recently, my client request me to add tab interface to the current theme. So, i googled the web and found a lot of free scripts to do so.  now, I am going to list down useful Javascript tabs that I found.

jQuery plugin

1) jQuery UI Tabs
jquery-ui-tabs
This tab script is built in to the jQuery UI and there are a lot of configurations. For example, you can have rotating tabs, nested tabs, and etc.

2) jQuery idTabs
jquery-idtabs
jQuery idTabs makes adding tabs into a website super simple, but it also open the door to endless possibilities.

3) Minitabs – jQuery minimalistic approach to tabs
Minitabs looks simple, but I can’t found any working demo from the website. [Read more...]

5 Extremely Simple Ways To Add Page Curl To Your Website

A lot of websites/blogs using page peel/page curl to add additional message such as advertisements at the corner. There are a lot of scripts that can achieve this function but unfortunately these scripts are not free.

Recently, 1 of my client requests me to implement page curl on his WordPress theme. So, I search through the internet and found some free and extremely simple ways to implement it.

1) Simple Page Peel Effect with jQuery and CSS by Soh Tanaka

simple-page-peel-effect-with-jquery-css
In this example, Soh Tanaka show us how to achieve the page peel effect using purely jQuery and CSS. [Read more...]

How To Debug With JavaScript

When used effectively, JavaScript debuggers help find and squash errors in your JavaScript code. To become an advanced JavaScript debugger, you’ll need to know about the debuggers available to you, the typical JavaScript debugging workflow, and code requirements for effective debugging. In this article, we’ll discuss advanced debugging techniques for diagnosing and treating bugs using a sample web application.

On accessibility

This article highlights strengths and differences between debugging tools, and shows how we perform advanced JavaScript debugging tasks. Our methods often rely on the mouse; if you prefer to use keyboard shortcuts, or if you rely on assistive technologies such as screen readers to interact with these tools, you should consult the relevant documentation to determine how (or if) these tools will work for you.

The debuggers

With an increasing selection of good debuggers available, JavaScript programmers can gain a lot from learning how to use them. JavaScript debugger user interfaces (UIs) are becoming more polished, more standardized across products, and easier to use, thus making it easier for both experts and novices to learn JavaScript debugging.

Currently, there are debugging tools available for all major web browsers. [Read more...]

Excellent Latest CSS Tutorials

Over the last few days I read over web design blogs and tutorials websites to finding the latest CSS tutorials what I can. As a web designer and developer it is vital that you have CSS skills so can create and modify sites as needed.  So collected of best 18 CSS tutorials and tips to show you the power of CSS3 without javascript or etc. [Read more...]

How to Insert Elements With DIV in JavaScript

Programmers can use JavaScript as the tools to modify the invisible framework of a Web page known as the Document Object Model (DOM).

The DOM is the application programming interface of HyperText Markup Language (HTML). The JavaScript method getElementById() can access the page division tag “div” to add or modify HTML styling information like backgrounds, fonts, borders, widths and positioning. In addition, the innerHTML property can change the content between the

tags.

HTML tags must be labeled with an ID before the getElementById() method can find and access them.

Create new file, enter the following code into the text editor:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

    <head>

        <style type="text/css"><!--

            #inner {

                width:200px;

                height:20px;

                background-color:red;

                color:white;

                font-size:15px;

                text-align:right;

            }

            --></style>

        <script language="javascript">

            function changeDiv(){

                document.getElementById("inner").style.width = "500px";

                document.getElementById("inner").style.height = "220px";

                document.getElementById("inner").style.fontSize = "62px";

                document.getElementById("inner").style.textAlign = "center";

                document.getElementById("inner").style.backgroundColor = "#FFB3B3";

                document.getElementById("inner").style.border = "4px dashed red";

                document.getElementById("inner").style.color = "black";

                document.getElementById("inner").innerHTML="JavaScript can insert styling and content elements into a Div";

                document.getElementById("mybutton").value = "And it works!";

            }

        </script>

    </head>

    <body>

        <div id="inner">here is the red div </div>

        <input id="mybutton" type="button" onClick="changeDiv()" value="Click this button to insert new info into the red div above" />

    </body>

</html>

 

 

Save the code as the name dom.html,and open it with Chrome or others.

How to Create Page Div As Draggable

Ever wanted to be able to create a draggable item on a webpage? If you want to add something to your page that is a little different from what most people include on Web pages, you can insert a “draggable” div.

A div is a section of your page that may include a grouping of text or images that is separate from the rest of the HTML page. You can make a div that the user can drag. This can be beneficial on Web pages that allow the user to customize his experience.

First, Insert this code in between the and tags on your page: [Read more...]

OPEN SOURCES(19): WEBSITE (FULL) TEMPLATES

[Read more...]

OPEN SOURCES(17): CLIENT SIDE AND EMULATING

[Read more...]