PDA

View Full Version : Can Cross Browser marquee II load data from external source?



ladyviola
05-10-2008, 07:46 AM
1) Script Title: Cross Browser marquee II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm

3) Describe problem: Is it possible for the above script to display contents from an external source such as an html or txt document? If so, can someone please show me how to modify the code to do so? Thanks so much in advance!!!


PS --I did check out the script located at http://www.dynamicdrive.com/dynamicindex2/emarquee.htm and it doesnt appear to work in firefox/netscape. I also checked out the iframe scroller and I dont really like that one as much as the Cross Browser marquee, so if at all possible I would like to use this particular script.

jscheuer1
05-10-2008, 03:57 PM
This can probably be worked out to some extent in javascript using xml or document.write(), or perhaps iframe*. However, if you have a server side language like PHP or asp available to you, that would be a much better way to go for importing a separate content file, as (at least as far as the importation part goes) it would be compatible with all browsers, even those that don't support the script.

The other script you mention is IE only.


* http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm

ladyviola
05-10-2008, 05:11 PM
Thanks for your support! Would you happen to know how to implement it or modfy the code? I do have PHP available. I did see a similar script on DD that uses iframes but I really would like to avoid using iframes if at all possible. Thanks again!!!

jscheuer1
05-10-2008, 07:15 PM
Just use an include where it calls for this:


<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">

<!--YOUR SCROLL CONTENT HERE-->

<h4>Your scroller contents</h4>

<!--YOUR SCROLL CONTENT HERE-->

</div>
</div>

like:


<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">

<!--YOUR SCROLL CONTENT HERE-->

<?php
include 'content.php';
?>

<!--YOUR SCROLL CONTENT HERE-->

</div>
</div>

Your top page with the javascript and the above on it will need the .php extension unless your server parses .htm and .html as PHP (most don't). The content.php can be just ordinary text or HTML, but can have valid PHP code on it if you like.

For more on the PHP include:

http://www.google.com/search?hl=en&client=opera&rls=en&q=PHP+include&btnG=Search

ladyviola
05-12-2008, 05:54 AM
Ah, that makes sense. I will try it! Thank you!!! :D:D:D

ETA: OMG it works like a charm! you're a genius :D Thank you!!