Log in

View Full Version : Crawler positioning on screen



3dkingpin
01-11-2012, 06:30 PM
Im using this script:

http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm

I create customized html and changed the values, it works fine but the width doesnt seem right, the height is right.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="en-UK">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC">
<TITLE>New Project</TITLE>
<style type="text/css"> .divScrollAuto {overflow:auto; white-space:nowrap;}</style>
<script type="text/javascript" src="crawler.js"></script>
</HEAD><BODY style="width: 1000px;height: 1000px;background-color: #FFFFFF; ">
<div class="marquee" id="newdiv1">>Enter Text</div><script type="text/javascript">marqueeInit({ uniqueid: "newdiv1", style: { "padding": "5px", "width": "529px", "height": "59px","background-color": "#00FF00","direction": "left", "border": "1px solid #CC3300" }, inc: 10, mouse: "cursor driven", moveatleast: 5, neutral: 264.50, savedirection: true});</script>
</BODY></HTML>


In the next version i wanted to position the div exactly on the browser window but the code below doesnt work



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="en-UK">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC">
<TITLE>New Project</TITLE>
<style type="text/css"> .divScrollAuto {overflow:auto; white-space:nowrap;}</style>
<script type="text/javascript" src="crawler.js"></script>
</HEAD><BODY style="width: 1000px;height: 1000px;background-color: #FFFFFF; ">
<div class="marquee" id="newdiv1" title="" style="overflow: hidden; white-space:nowrap; top: 100; left: 269; position: absolute; z-index: 101; width: 431px; height: 120px; ">Those confounded friars dully buzz that faltering jay. An appraising tongue acutely causes our courageous hogs. Their fitting submarines deftly break your approving improvisations. Her downcast taxonomies actually box up those disgusted turtles.Enter Text</div><script type="text/javascript">marqueeInit({ uniqueid: "newdiv1", style: { "padding": "5px", "width": "431px", "height": "120px","background-color": "#FF8040","direction": "left", "border": "1px solid #CC3300" }, inc: 10, mouse: "cursor driven", moveatleast: 5, neutral: 215.50, savedirection: true});</script>


</BODY></HTML>



any ideas.

jscheuer1
01-11-2012, 07:09 PM
Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

I know those are only code snippets, but you do need to have the copyright notice on the page.

That said, In the first example, there isn't enough text to fill out the 529px width that's specified.

In the second example, you've done something that the script doesn't allow, namely given the marquee division itself style. For what you're trying to do there, you may use a container div:


<divs style="overflow: hidden; white-space:nowrap; top: 100; left: 269; position: absolute; z-index: 101; width: 431px; height: 120px; ">
<div class="marquee" id="newdiv1">Those confounded friars dully buzz that faltering jay. An appraising tongue acutely causes our courageous hogs. Their fitting submarines deftly break your approving improvisations. Her downcast taxonomies actually box up those disgusted turtles.Enter Text</div>
</div>
<script type="text/javascript">marqueeInit({
uniqueid: "newdiv1",
style: {
"padding": "5px",
"width": "431px",
"height": "120px",
"background-color": "#FF8040",
"direction": "left", // <-- Get rid of this
"border": "1px solid #CC3300"
},
inc: 10,
mouse: "cursor driven",
moveatleast: 5,
neutral: 215.50,
savedirection: true
});
</script>

Also, in the style section of the marqueeInit, I don't believe "direction": "left", is valid. The direction property in style must be ltr or rtl, possibly ttb or btt, it's how the text reads in the element (right to left, or left to right), and would have nothing to do with the direction of the marquee. However the default direction for any marquee is left, so that's what will happen. I'd remove it from the style section though, it may be causing an error.

With both of these examples, there could also be other problems.

If you want more help, please post a link to the page on your site that contains the problematic code so we can check it out.

3dkingpin
01-11-2012, 09:03 PM
the manual says use left or right for direction

direction: 'right', ('right' or 'left') Direction of marquee. (defaults to 'left' - easiest for reading text marquees)

Also thanks for pointing out the copyright requirement I will add it to the final source code.

jscheuer1
01-11-2012, 10:46 PM
Yes, the manual says that. But it's not to be as part of the style, as you had it. You could do:


<script type="text/javascript">marqueeInit({
uniqueid: "newdiv1",
style: {
"padding": "5px",
"width": "431px",
"height": "120px",
"background-color": "#FF8040",
"border": "1px solid #CC3300"
},
inc: 10,
mouse: "cursor driven",
direction: "left",
moveatleast: 5,
neutral: 215.50,
savedirection: true
});
</script>

But, since it's the default, just get rid of it like I said.

3dkingpin
01-12-2012, 01:53 AM
ok made this (www.rafnet.co.uk/crawler.html)one with your tip. it works, but the black border is missing two edges

jscheuer1
01-12-2012, 03:05 AM
Withe padding, the marquee is taller and wider than the container whose overflow is hidden. You could work out the math more precisely so that the entire marquee, border included could be seen. But it would be easier to remove the border from the marqueeInit and add it to the container.

3dkingpin
01-25-2012, 03:35 AM
when using pictures in the marquee how do you crop or downsize llarger images so they fit the marquee height??