Results 1 to 3 of 3

Thread: Text and Image Crawler in hidden div ?

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Text and Image Crawler in hidden div ?

    1) Script Title: Text and Image Crawler v1.5

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...wler/index.htm

    3) Describe problem:

    I have a hidden div and it contains the text crawler.
    After click a button, the div should be display and show the text crawler, however, the text crawler scroll to left and disappear, any idea?


    My code:

    <html>
    <body>
    <style>
    #div div{
    height:300px;
    }
    </style>
    <script type="text/javascript" src="crawler.js"></script>
    <input type="button" value="Show" onclick="div1.style.display='block';" div1" />
    <div id="div1" style="display:none">
    <div class="marquee" id="crawler1">Testing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    </div>
    </div>

    <script type="text/javascript">
    marqueeInit({uniqueid: 'crawler1',style: {'width': '300px','height':'100px'},inc:1,mouse: 'cursor driven',moveatleast: 1,neutral: 150,savedirection: true});
    </script>
    </body>
    </html>

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    you can not initialize with display none

    but you can
    Code:
    <input type="button" value="Show" onclick="div1.style.display='block';" />
    <div id="div1" >
    <div class="marquee" id="crawler1">Testing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    </div>
    </div>
    <script type="text/javascript">
    marqueeInit({uniqueid: 'crawler1',style: {'width': '300px','height':'100px'},inc:1,mouse: 'cursor driven',moveatleast: 1,neutral: 150,savedirection: true});
    document.getElementById('div1').style.display='none';;
    </script>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Quote Originally Posted by vwphillips View Post
    you can not initialize with display none

    but you can
    Code:
    <input type="button" value="Show" onclick="div1.style.display='block';" />
    <div id="div1" >
    <div class="marquee" id="crawler1">Testing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    </div>
    </div>
    <script type="text/javascript">
    marqueeInit({uniqueid: 'crawler1',style: {'width': '300px','height':'100px'},inc:1,mouse: 'cursor driven',moveatleast: 1,neutral: 150,savedirection: true});
    document.getElementById('div1').style.display='none';;
    </script>
    It work!! Thanks for your prompt reply!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •