Archive for java script

Show or Hide Div content when click on Button or text

Sometime we are willing to show some content only after clicking on submit button or text and hide it back on clicking on the same button or text
it’s useful when you have bunch of Details information that needs a lot of space and you want to give users to chose if they want to see this details
to do so we should create a java script function like this

Read more

Hide and clear input value on click and return it back (show value) when blank

If you want to show some text or value in input tag explaining what people should type and clear when they are typing and also return text or value back if they left that blank we should add some java script code to our input tag like this:

<input type="text" value="Type anything you want" onfocus="if(this.value == 'Type anything you want') { this.value = ''; }" onblur="if(this.value=='') { this.value='Type anything you want'; }" style="color:#555; width:320px;border:1px solid #222;"/>

Example:

display loading image after clicking on a submit button java script jquery

If you want to show animated gif image after clicking on a submit button to show users that request is on process , here we show you how to do that in so simple way: Let’s assume that we have a form like below:

Read more

How to hide, show, or toggle your div

Are you trying to find a way to hide and show your content? The demo below shows a simple yet elegant way of toggling your content and toggling the control text via Javascript and styling.

Read more

Display a loading gif image before a page loads using javascript and Css

Have you ever need to showing a loading image before bage loading?Like this demo.

to do that at first we well need a CSS like below

Read more

Best JQuery noConflict method

There is some ways to resolving conflicts with other javascript libraries but i will show you most effective method to using multiple java script or jQuery codes in same page

Read more