Question: When I use different layouts to support different screens , should I use dp or px .

Answer: 
You should use the [jquery `.toggle`](http://api.jquery.com/toggle/) or [jquery UI `.toggle`](http://api.jqueryui.com/toggle/) method which does just that.

But the error in your logic is the `$('.reply').css('display', 'none')`. This sets the `display` to `none`. It does not check if it is `none`...

If you had to use that code you should change it to

```
if ( $('.reply').css('display') === 'none') )

```
```
$(".fold_reply").click(function() { 
     var style=$('.reply').css('display');
    if (style=='none') {
        $(".reply").show(500);
    }
    else {
        $(".reply").hide(500);
    }

});​

<input type="button" class='fold_reply' value="button">

<div class='reply'>
    text<br/>text<br/>text<br/>text<br/>text
</div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

```

**[Working Demo](http://jsfiddle.net/DQvZT/)**