Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2009, 06:23 AM
edurazee
Guest
 
Posts: n/a
Default How to achieve DIV resize animation with pure JavaScript + asp.net?

I am trying to achieve an animation using pure JavaScript with DIV.

Code:
<body>
    <form id="form1" runat="server">
    <div>
        <script language="javascript" type="text/javascript">
            <!--
                //This hides javaScript from old browsers
            

            var width = 400;
            var height = 200;
            function ResizeDIV() {
                width = width - 2;
                height = height - 1;

                var divElement = document.getElementById('div1');

                divElement.style.width = width;
                divElement.style.height = height;
            }

            setInterval('ResizeDIV()', 5000);
            
            
            //-->
        </script>
    </div>
    <div id="div1" class="divStyle">
    hakdjaksdhajksdkasdkasdk
    </div>
    </form>
</body>
But this is not working.

How can I do that in most simplest way?
 
Old December 13th, 2009, 10:36 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

not 100% sure
but try moving the div tag with id=div1 above the script tag

as you can't access objects not yet created.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
IMage resize,croping ,transfarant etc. asp.net sanjay30784 ASP.NET 2.0 Basics 1 November 27th, 2008 10:26 AM
ASP pure script upload ittorget Classic ASP Basics 13 November 5th, 2007 03:57 AM
Pure ASP Upload ozzii Classic ASP Professional 1 January 8th, 2007 06:41 PM
PURE asp upload problem ., alert from Javascript kasanar ASP.NET 1.0 and 1.1 Professional 0 February 19th, 2005 10:06 AM
flash animation in asp.net mistry_bhavin Classic ASP Basics 1 October 29th, 2004 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.