PDA

View Full Version : Centering Image marquee crawler issue



fankfulpixy
01-17-2011, 05:59 AM
Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm

I am using this link to create a marquee that can be controlled left/right with the mouse. However, my the image starts changing directions 3/4 of the way across the screen rather than directly centered. In my case I have one image that I want to be 2000px wide while the div is 100% wide. I changed nothing to the site's javascript crawler file, so I cannot figure out what is happening and how to get this code to work for my situation.

any help would be MUCH appreciated.


Here is my code for the crawler and div:

<div class="marquee" id="mycrawler2" style="width:100%;height:450px;">
<img src="test.jpg" width="2000" height="450"/>
</div>

<script type="text/javascript">
marqueeInit({
uniqueid: 'mycrawler2',
style: {
'padding': '0px',
'width': '2000px',
'height': '450px'
},
inc: 50, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 500,
savedirection: false
});
</script>

jscheuer1
01-17-2011, 06:37 AM
I don't think anyone has ever done just one image with this script. At least not and had a problem that they asked about it here.

Anyways, even with a 'normal' crawler, you shouldn't specify style inline for the container.

So try it without the highlighted:



<div class="marquee" id="mycrawler2" style="width:100%;height:450px;">
<img src="test.jpg" width="2000" height="450"/>
</div>

<script type="text/javascript">
marqueeInit({
uniqueid: 'mycrawler2',
style: {
'padding': '0px',
'width': '2000px',
'height': '450px'
},
inc: 50, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 500,
savedirection: false
});
</script>

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

fankfulpixy
01-17-2011, 07:56 AM
Thank you that worked!