1

i have this code and it worke five minutes ago , when i restart my app it does not work , i don't know whyyyyyy :

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script>
        $(document).click(function () { 


            var div = $('.idbody');
            div.animate({ top: '20%' }, "slow"); 
            });

    </script>

<div class="idbody">
.............My html code ............
</div>

thank you

8
  • clear browser cache and try. Commented Feb 18, 2014 at 11:47
  • What error have you?? Commented Feb 18, 2014 at 11:47
  • no error i just doesn't work :'( Commented Feb 18, 2014 at 11:49
  • @Pilot it worked 15min ago :/ Commented Feb 18, 2014 at 11:50
  • do you have any error in your browser's console? Commented Feb 18, 2014 at 11:53

3 Answers 3

5

Try this:

HTML Code:

<div class="idbody">.............My html code ............</div>

CSS Code:

.idbody
        {
            background: url(images/fondbodyrepeatos.png) repeat;
            width: 400px;
            height: 250px;
            position: absolute;
            top: -50%;
            left: 32%;
            box-shadow: 1px 1px 35px #014668;
            border-radius: 10px;
            padding-left: 5%;
        }

Jquery Code:

$(document).ready(function () {
    $(document).click(function () {
        var div = $('.idbody');
        $('div').animate({
            top: '+=20%'
            }, 'slow', function() {
            // Animation complete.
        });
    });
});

DEMO

Sign up to request clarification or add additional context in comments.

7 Comments

You need to place the position for that div.nice job deepak
i saw many demo and when i try to do it with the same code , it doesn't work too
@Meryem, check my code in this link, jsfiddle.net/realdeepak/LSk2S/2
My fiddle link is working. If you are unable to check it then share your code on jsfiddle.
|
0

It probably because of the problem with your internet connection. Try download the jquery file and keep it locally. save this file jquery

1 Comment

what jquery file and how can i keep it locally .thank you
0

ITTT WOOOORK .....with your code and i added this files :

<script src="Script/jquery-1.10.2.js" type="text/javascript"></script>
<script src="Script/_jquery-2.0.2.js" type="text/javascript"></script>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.