PDA

View Full Version : Text and Image Crawler in hidden div ?



Laml
02-27-2012, 09:14 AM
1) Script Title: Text and Image Crawler v1.5

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/crawler/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>

vwphillips
02-27-2012, 10:13 AM
you can not initialize with display none

but you can

<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>

Laml
02-28-2012, 07:13 AM
you can not initialize with display none

but you can

<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!!